Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Interface file fixes #645

Merged
merged 18 commits into from
Jun 23, 2020
Merged

Interface file fixes #645

merged 18 commits into from
Jun 23, 2020

Conversation

pepeiborra
Copy link
Collaborator

Includes potential fixes for several issues as well as new tests contributed by @wz1000

I still don't fully understand how much recompilation avoidance is provided by GHC and how much needs to be implemented by the application, so it's possible that further work is needed.

@pepeiborra pepeiborra changed the title Hi file changes Interface file fixes Jun 17, 2020
@pepeiborra pepeiborra marked this pull request as draft June 18, 2020 09:16
@pepeiborra
Copy link
Collaborator Author

This is a massive performance regression. Not sure how that happened:

version                                    name                         success   samples   startup              setup                experiment           maxResidency
upstream                                   hover                        True      100       10.008805828         0.0                  1.0496357980000002   138MB
upstream                                   edit                         True      100       10.342245301         0.0                  40.515747643000005   137MB
upstream                                   getDefinition                True      100       20.589914577000002   0.0                  0.537914714          324MB
upstream                                   hover after edit             True      100       9.944694886          0.0                  89.364840677         156MB
upstream                                   completions after edit       True      100       9.465573668000001    0.0                  50.609864630000004   148MB
upstream                                   code actions                 True      100       9.376972059          0.6628133180000001   0.96582895           166MB
upstream                                   code actions after edit      True      100       10.779993297         0.0                  41.802328869         171MB
upstream                                   documentSymbols after edit   True      100       9.692719622          0.0                  3.1590869070000003   133MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   hover                        True      100       6.223012398000001    0.0                  10.586891355         197MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   edit                         True      100       5.159852353000001    0.0                  598.7098546120001    292MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   getDefinition                True      100       5.306326698          0.0                  10.629264252         198MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   hover after edit             True      100       5.547018304000001    0.0                  600.838449804        279MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   completions after edit       True      100       5.374164883000001    0.0                  597.356897093        287MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   code actions                 False     100       5.434037030000001    0.615423809          1.130345192          32MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   code actions after edit      True      100       5.755494079          0.0                  622.967272365        301MB
d80f24bf4c33e3af3f5a6acb4a67f7d9ac55c025   documentSymbols after edit   True      100       5.709243778          0.0                  3.7647437750000003   19MB

Will investigate, moving it to draft

@wz1000
Copy link
Collaborator

wz1000 commented Jun 18, 2020

I have tested this locally and it seems to work as expected. Thanks!

@pepeiborra
Copy link
Collaborator Author

This is ready for review now. Updated benchmark results:

version    name                         success   samples   startup              setup                experiment           maxResidency
upstream   hover                        True      100       5.8482816820000005   0.0                  4.9454744690000005   134MB
upstream   edit                         True      100       5.31275002           0.0                  37.709283213         137MB
upstream   getDefinition                True      100       5.155887724          0.0                  5.071040086          134MB
upstream   hover after edit             True      100       5.644519141          0.0                  43.601127911000006   140MB
upstream   completions after edit       True      100       5.398684477000001    0.0                  46.015129607000006   147MB
upstream   code actions                 False     100       5.466472249000001    0.618790633          0.8490837990000001   34MB
upstream   code actions after edit      True      100       5.246707075000001    0.0                  37.09777081          169MB
upstream   documentSymbols after edit   True      100       5.580899209          0.0                  3.5008937340000004   19MB
HEAD       hover                        True      100       5.149210662000001    0.0                  4.889111615          169MB
HEAD       edit                         True      100       5.018361984          0.0                  37.767128066000005   170MB
HEAD       getDefinition                True      100       5.035206842          0.0                  5.522657187          171MB
HEAD       hover after edit             True      100       5.028756785000001    0.0                  46.070039352         172MB
HEAD       completions after edit       True      100       5.142401647000001    0.0                  48.040290077         176MB
HEAD       code actions                 False     100       5.0633711550000005   0.5794819330000001   0.73311331           102MB
HEAD       code actions after edit      True      100       5.168948583000001    0.0                  39.832205435000006   201MB
HEAD       documentSymbols after edit   False     100       5.080390604000001    0.0                  5.228939e-3          0MB

@pepeiborra pepeiborra marked this pull request as ready for review June 19, 2020 12:45
@wz1000
Copy link
Collaborator

wz1000 commented Jun 19, 2020

HEAD       documentSymbols after edit   False     100       5.080390604000001    0.0                  5.228939e-3          0MB

This result seems strange

@pepeiborra
Copy link
Collaborator Author

pepeiborra commented Jun 19, 2020

HEAD       documentSymbols after edit   False     100       5.080390604000001    0.0                  5.228939e-3          0MB

This result seems strange

Benchmarks are failing or succeeding with inaccurate timings because of multiple WorkDoneProgressEnd notifications during initialisation. I can confirm that all benchmarks pass for this branch plus #649.

@pepeiborra
Copy link
Collaborator Author

We should reuse the benchmark experiments as tests, to make sure they stay running.

Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks plausible but I’m having a hard time figuring out which of the changes are actually the ones fixing the test cases. Could you help me out here?

@@ -0,0 +1 @@
cradle: {cabal: {component: "lib:recomp"}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this to be a cabal cradle? I’d rather limit that to stuff where we cannot easily use a direct-style cradle (mainly multi-component).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wz1000 any thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a direct cradle would also work, I can make a PR by tonight if you don't get to it sooner.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try switching to the trivial direct cradle with only the -ilib option, I see ghcide creating a lot more HscEnvEq environments, which results in a larger volume of NotWorkDoneProgressEnd messages which confuse the test and make it fail.

I think that multi-cradle requires cradles to enumerate all the modules, but I'm not sure how to do that with a direct cradle.

Test logs with my direct cradle:

> Executing task: nix-shell --run 'cabal test --test-show-details=always --test-options="-p iface-error-test-1"' <

Warning: The package list for 'hackage.haskell.org' is 44 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - ghcide-0.2.0 (lib) (configuration changed)
 - ghcide-0.2.0 (exe:ghcide-test-preprocessor) (configuration changed)
 - ghcide-0.2.0 (exe:ghcide) (configuration changed)
 - ghcide-0.2.0 (test:ghcide-tests) (configuration changed)
Configuring library for ghcide-0.2.0..
Configuring executable 'ghcide-test-preprocessor' for ghcide-0.2.0..
Preprocessing executable 'ghcide-test-preprocessor' for ghcide-0.2.0..
Building executable 'ghcide-test-preprocessor' for ghcide-0.2.0..
Preprocessing library for ghcide-0.2.0..
Building library for ghcide-0.2.0..
Configuring executable 'ghcide' for ghcide-0.2.0..
Warning: The package has an extraneous version range for a dependency on an
internal library: ghcide -any && ==0.2.0, ghcide -any && ==0.2.0, ghcide -any
&& ==0.2.0. This version range includes the current package but isn't needed
as the current package's library will always be used.
Preprocessing executable 'ghcide' for ghcide-0.2.0..
Building executable 'ghcide' for ghcide-0.2.0..
Configuring test suite 'ghcide-tests' for ghcide-0.2.0..
Warning: The package has an extraneous version range for a dependency on an
internal library: ghcide -any && ==0.2.0, ghcide -any && ==0.2.0, ghcide -any
&& ==0.2.0. This version range includes the current package but isn't needed
as the current package's library will always be used.
Preprocessing test suite 'ghcide-tests' for ghcide-0.2.0..
Building test suite 'ghcide-tests' for ghcide-0.2.0..
Running 1 test suites...
Test suite ghcide-tests: RUNNING...
HIE
  Interface loading tests
    iface-error-test-1: --> {
    "jsonrpc": "2.0",
    "params": {
        "rootUri": "file:///run/user/1000/snap.code/extra-dir-68570152739173",
        "processId": 237877,
        "rootPath": "/run/user/1000/snap.code/extra-dir-68570152739173",
        "capabilities": {
            "window": {
                "workDoneProgress": true
            },
            "workspace": {
                "didChangeWatchedFiles": {
                    "dynamicRegistration": true
                },
                "symbol": {
                    "symbolKind": {
                        "valueSet": [
                            1,
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25,
                            26
                        ]
                    },
                    "dynamicRegistration": true
                },
                "workspaceEdit": {
                    "documentChanges": true
                },
                "didChangeConfiguration": {
                    "dynamicRegistration": true
                },
                "applyEdit": true,
                "executeCommand": {
                    "dynamicRegistration": true
                },
                "workspaceFolders": true,
                "configuration": true
            },
            "textDocument": {
                "completion": {
                    "dynamicRegistration": true,
                    "contextSupport": true,
                    "completionItem": {
                        "tagSupport": {
                            "valueSet": [
                                1
                            ]
                        },
                        "preselectSupport": true,
                        "commitCharactersSupport": true,
                        "snippetSupport": true,
                        "deprecatedSupport": true,
                        "documentationFormat": [
                            "plaintext",
                            "markdown"
                        ]
                    },
                    "completionItemKind": {
                        "valueSet": [
                            1,
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25
                        ]
                    }
                },
                "documentHighlight": {
                    "dynamicRegistration": true
                },
                "synchronization": {
                    "dynamicRegistration": true,
                    "willSave": true,
                    "didSave": true,
                    "willSaveWaitUntil": true
                },
                "definition": {
                    "dynamicRegistration": true
                },
                "signatureHelp": {
                    "dynamicRegistration": true,
                    "signatureInformation": {
                        "ocumentationFormat": [
                            "plaintext",
                            "markdown"
                        ]
                    }
                },
                "references": {
                    "dynamicRegistration": true
                },
                "rangeFormatting": {
                    "dynamicRegistration": true
                },
                "codeAction": {
                    "codeActionLiteralSupport": {
                        "codeActionKind": {
                            "valueSet": [
                                "quickfix",
                                "refactor",
                                "refactor.extract",
                                "refactor.inline",
                                "refactor.rewrite",
                                "source",
                                "source.organizeImports"
                            ]
                        }
                    },
                    "dynamicRegistration": true
                },
                "foldingRange": {
                    "lineFoldingOnly": false,
                    "dynamicRegistration": true
                },
                "onTypeFormatting": {
                    "dynamicRegistration": true
                },
                "codeLens": {
                    "dynamicRegistration": true
                },
                "documentSymbol": {
                    "hierarchicalDocumentSymbolSupport": true,
                    "symbolKind": {
                        "valueSet": [
                            1,
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25,
                            26
                        ]
                    },
                    "dynamicRegistration": true
                },
                "colorProvider": {
                    "dynamicRegistration": true
                },
                "documentLink": {
                    "dynamicRegistration": true
                },
                "formatting": {
                    "dynamicRegistration": true
                },
                "implementation": {
                    "dynamicRegistration": true
                },
                "typeDefinition": {
                    "dynamicRegistration": true
                },
                "publishDiagnostics": {
                    "tagSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    },
                    "relatedInformation": true
                },
                "rename": {
                    "prepareSupport": true,
                    "dynamicRegistration": true
                },
                "hover": {
                    "contentFormat": [
                        "plaintext",
                        "markdown"
                    ],
                    "dynamicRegistration": true
                }
            }
        },
        "trace": "off"
    },
    "method": "initialize",
    "id": 0
}
ghcide version: 0.2.0 (GHC: 8.10.1) (PATH: /home/pepe/scratch/ghcide/dist-newstyle/build/x86_64-linux/ghc-8.10.1/ghcide-0.2.0/x/ghcide/build/ghcide/ghcide) (GIT hash: f07857babd6ca476ed1d89c1d8c189eec5017d51)
Starting LSP server...
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.00s
<-- {
    "tag": "RspInitialize",
    "contents": {
        "result": {
            "capabilities": {
                "typeDefinitionProvider": true,
                "foldingRangeProvider": false,
                "textDocumentSync": {
                    "openClose": true,
                    "change": 2,
                    "save": {}
                },
                "workspace": {
                    "workspaceFolders": {
                        "supported": true,
                        "changeNotifications": true
                    }
                },
                "implementationProvider": true,
                "executeCommandProvider": {
                    "commands": [
                        "237883:ghcide:typesignature.add"
                    ]
                },
                "renameProvider": false,
                "colorProvider": false,
                "definitionProvider": true,
                "hoverProvider": true,
                "codeActionProvider": true,
                "completionProvider": {
                    "triggerCharacters": [
                        "."
                    ],
                    "resolveProvider": false
                },
                "codeLensProvider": {},
                "documentSymbolProvider": true
            }
        },
        "jsonrpc": "2.0",
        "id": 0
    }
}
--> {
    "jsonrpc": "2.0",
    "params": {},
    "method": "initialized"
}
--> {
    "jsonrpc": "2.0",
    "params": {
        "textDocument": {
            "languageId": "haskell",
            "text": "module B(y) where\n\ny :: Int\ny = undefined\n",
            "uri": "file:///run/user/1000/snap.code/extra-dir-68570152739173/B.hs",
            "version": 0
        }
    },
    "method": "textDocument/didOpen"
}
--> {
    "jsonrpc": "2.0",
    "params": {
        "textDocument": {
            "languageId": "haskell",
            "text": "module P() where\nimport A\nimport B\n\nbar = x :: Int\n",
            "uri": "file:///run/user/1000/snap.code/extra-dir-68570152739173/P.hs",
            "version": 0
        }
    },
    "method": "textDocument/didOpen"
}
[DEBUG] Set files of interest to: [NormalizedFilePath "/run/user/1000/snap.code/extra-dir-68570152739173/B.hs"]
[DEBUG] Restarting build session (aborting the previous one took 0.00s)
[INFO] Opened text document: file:///run/user/1000/snap.code/extra-dir-68570152739173/B.hs
[DEBUG] Set files of interest to: [NormalizedFilePath "/run/user/1000/snap.code/extra-dir-68570152739173/P.hs",NormalizedFilePath "/run/user/1000/snap.code/extra-dir-68570152739173/B.hs"]
[DEBUG] Finishing build session(exception: AsyncCancelled)
[DEBUG] Restarting build session (aborting the previous one took 0.00s)
[INFO] Opened text document: file:///run/user/1000/snap.code/extra-dir-68570152739173/P.hs
<-- {
    "tag": "ReqWorkDoneProgressCreate",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "token": "1"
        },
        "method": "window/workDoneProgress/create",
        "id": 0
    }
}
<-- {
    "tag": "NotWorkDoneProgressBegin",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "value": {
                "kind": "begin",
                "title": "Processing"
            },
            "token": "1"
        },
        "method": "$/progress"
    }
}
[INFO] Consulting the cradle for "/run/user/1000/snap.code/extra-dir-68570152739173/P.hs"
<-- {
    "tag": "NotCustomServer",
    "contents": {
        "jsonrpc": "2.0",
        "params": "/run/user/1000/snap.code/extra-dir-68570152739173/P.hs",
        "method": "ghcide/cradle/loaded"
    }
}
[DEBUG] Session loading result: Right (ComponentOptions {componentOptions = [], componentRoot = "/run/user/1000/snap.code/extra-dir-68570152739173", componentDependencies = []})
<-- {
    "tag": "ReqWorkDoneProgressCreate",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "token": 0
        },
        "method": "window/workDoneProgress/create",
        "id": 1
    }
}
<-- {
    "tag": "NotWorkDoneProgressBegin",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "value": {
                "kind": "begin",
                "cancellable": false,
                "title": "Setting up project extra-dir-68570152739173"
            },
            "token": 0
        },
        "method": "$/progress"
    }
}
<-- {
    "tag": "NotWorkDoneProgressEnd",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "value": {
                "kind": "end"
            },
            "token": 0
        },
        "method": "$/progress"
    }
}
[INFO] Using interface files cache dir: /home/pepe/.cache/ghcide/main-da39a3ee5e6b4b0d3255bfef95601890afd80709
[INFO] Making new HscEnv[main]
[DEBUG] New Component Cache HscEnvEq: (([],Just HscEnvEq 2),fromList [("/run/user/1000/snap.code/extra-dir-68570152739173/hie.yaml",Just 2020-06-23 07:33:13.724195737 UTC)])
[DEBUG] Restarting build session (aborting the previous one took 0.00s)
[DEBUG] Finishing build session(exception: AsyncCancelled)
[INFO] Consulting the cradle for "/run/user/1000/snap.code/extra-dir-68570152739173/B.hs"
[DEBUG] Session loading result: Right (ComponentOptions {componentOptions = [], componentRoot = "/run/user/1000/snap.code/extra-dir-68570152739173", componentDependencies = []})
<-- {
    "tag": "NotCustomServer",
    "contents": {
        "jsonrpc": "2.0",
        "params": "/run/user/1000/snap.code/extra-dir-68570152739173/B.hs",
        "method": "ghcide/cradle/loaded"
    }
}
<-- {
    "tag": "ReqWorkDoneProgressCreate",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "token": 1
        },
        "method": "window/workDoneProgress/create",
        "id": 2
    }
}
<-- {
    "tag": "NotWorkDoneProgressBegin",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "value": {
                "kind": "begin",
                "cancellable": false,
                "title": "Setting up project extra-dir-68570152739173"
            },
            "token": 1
        },
        "method": "$/progress"
    }
}
<-- {
    "tag": "NotWorkDoneProgressEnd",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "value": {
                "kind": "end"
            },
            "token": 1
        },
        "method": "$/progress"
    }
}
[INFO] Using interface files cache dir: /home/pepe/.cache/ghcide/main-da39a3ee5e6b4b0d3255bfef95601890afd80709
[INFO] Using interface files cache dir: /home/pepe/.cache/ghcide/main-da39a3ee5e6b4b0d3255bfef95601890afd80709
[INFO] Making new HscEnv[main,main]
[DEBUG] New Component Cache HscEnvEq: (([],Just HscEnvEq 3),fromList [("/run/user/1000/snap.code/extra-dir-68570152739173/hie.yaml",Just 2020-06-23 07:33:13.724195737 UTC)])
[DEBUG] New Component Cache HscEnvEq: (([],Just HscEnvEq 4),fromList [("/run/user/1000/snap.code/extra-dir-68570152739173/hie.yaml",Just 2020-06-23 07:33:13.724195737 UTC)])
[DEBUG] Restarting build session (aborting the previous one took 0.00s)
[DEBUG] Finishing build session(exception: AsyncCancelled)
<-- {
    "tag": "ReqRegisterCapability",
    "contents": {
        "jsonrpc": "2.0",
        "params": {
            "registrations": [
                {
                    The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that’s a good point! What happens if you just specify the module names after the -i option? I believe that’s how cabal repl does it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See pepeiborra#3

I didn't make the PR yesterday because I'm unable to compile the tests because of a weird linker error. Right now I've nuked my cabal store and am rebuilding the world from scratch. I will let you know how that goes.

I think this issue should not come up with my changes because I removed the lib directory

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your direct cradle enumerates all the modules, which I didn't. I've merged it to the branch, let's see if the tests pass.

test/exe/Main.hs Show resolved Hide resolved
test/exe/Main.hs Outdated Show resolved Hide resolved
test/exe/Main.hs Outdated Show resolved Hide resolved
test/exe/Main.hs Outdated Show resolved Hide resolved
src/Development/IDE/Core/Compile.hs Outdated Show resolved Hide resolved
src/Development/IDE/Core/Compile.hs Outdated Show resolved Hide resolved
src/Development/IDE/Core/Compile.hs Show resolved Hide resolved
src/Development/IDE/Core/FileStore.hs Outdated Show resolved Hide resolved
src/Development/IDE/Core/Rules.hs Outdated Show resolved Hide resolved
@pepeiborra
Copy link
Collaborator Author

pepeiborra commented Jun 22, 2020

Looks plausible but I’m having a hard time figuring out which of the changes are actually the ones fixing the test cases. Could you help me out here?

There's a comment about this in the commit message of the first commit. Reproducing it here:

This started as a pure refactoring to clarify the responsibilities between
ModIface and ModIfaceFromDisk, but ended up having some behaviour changes:

  1. Regenerate interface when checkOldIface returns something other than UpToDate. This was a bug.
  1. Do not generate a diagnostic when regenerating an interface.
  1. Previously we conflated stale interface with other errors,and would regenerate in both cases. Now we only regenerate in the first case.

So previously we were not handling the return value of checkOldIface correctly, which could lead to reusing stale interface files.

Moreover, we were not loading all the transitive dependencies in the Ghc session used by loadInterface, only the direct ones, which I think was confusing checkOldIface.

@pepeiborra
Copy link
Collaborator Author

rebased

@cocreature
Copy link
Collaborator

Thanks for the explanation!

pepeiborra and others added 16 commits June 23, 2020 08:33
This started as a pure refactoring to clarify the responsibilities between
ModIface and ModIfaceFromDisk, but ended up having some behaviour changes:

1. Regenerate interface when checkOldIface returns something other than
UpToDate. This was a bug.

2. Do not generate a diagnostic when regenerating an interface.

2. Previously we conflated stale interface with other errors,
and would regenerate in both cases. Now we only regenerate in the first case.

Tentative fix for #597
Tentative fix for #614

TODO support stability
The previous changes were 10X slower, this is 20X faster than those, so 2X
faster than upstream, for some benchmarks
The answer for a GetModification query is independent of the missingFileDiagnostics field
(as the diagnostics are not part of the answer)
Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks @wz1000 for switching it over to a direct cradle.

@cocreature cocreature merged commit d4fd99e into haskell:master Jun 23, 2020
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Add test for inconsistent diagnostics

* Refactoring ModIfaceFromDisk

This started as a pure refactoring to clarify the responsibilities between
ModIface and ModIfaceFromDisk, but ended up having some behaviour changes:

1. Regenerate interface when checkOldIface returns something other than
UpToDate. This was a bug.

2. Do not generate a diagnostic when regenerating an interface.

2. Previously we conflated stale interface with other errors,
and would regenerate in both cases. Now we only regenerate in the first case.

Tentative fix for haskell/ghcide#597

* Split interface tests

* Always recompile modules with TH splices

Tentative fix for haskell/ghcide#614

TODO support stability

* Fix expectDiagnostics in MacOs

* Avoid File does not exist diagnostics for interface files

Fixes haskell/ghcide#642

* Clarify interface tests

* hlints

* Performance fixes

The previous changes were 10X slower, this is 20X faster than those, so 2X
faster than upstream, for some benchmarks

* formatting

* Fix GetModificationTime identity

The answer for a GetModification query is independent of the missingFileDiagnostics field
(as the diagnostics are not part of the answer)

* remove stale comment

* Avoid calling ghcSessionDepsDefinition twice

* Apply suggestions from code review

Co-authored-by: Moritz Kiefer <[email protected]>

* Code review feedback

* Address review feedback

https://github.com/digital-asset/ghcide/pull/645/files/49b0d9ac65399edf82a7a9cbbb8d8b5420458d8dhaskell/ghcide#r443383239

* Change recomp to direct cradle

Co-authored-by: Zubin Duggal <[email protected]>
Co-authored-by: Moritz Kiefer <[email protected]>
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Add test for inconsistent diagnostics

* Refactoring ModIfaceFromDisk

This started as a pure refactoring to clarify the responsibilities between
ModIface and ModIfaceFromDisk, but ended up having some behaviour changes:

1. Regenerate interface when checkOldIface returns something other than
UpToDate. This was a bug.

2. Do not generate a diagnostic when regenerating an interface.

2. Previously we conflated stale interface with other errors,
and would regenerate in both cases. Now we only regenerate in the first case.

Tentative fix for haskell/ghcide#597

* Split interface tests

* Always recompile modules with TH splices

Tentative fix for haskell/ghcide#614

TODO support stability

* Fix expectDiagnostics in MacOs

* Avoid File does not exist diagnostics for interface files

Fixes haskell/ghcide#642

* Clarify interface tests

* hlints

* Performance fixes

The previous changes were 10X slower, this is 20X faster than those, so 2X
faster than upstream, for some benchmarks

* formatting

* Fix GetModificationTime identity

The answer for a GetModification query is independent of the missingFileDiagnostics field
(as the diagnostics are not part of the answer)

* remove stale comment

* Avoid calling ghcSessionDepsDefinition twice

* Apply suggestions from code review

Co-authored-by: Moritz Kiefer <[email protected]>

* Code review feedback

* Address review feedback

https://github.com/digital-asset/ghcide/pull/645/files/49b0d9ac65399edf82a7a9cbbb8d8b5420458d8dhaskell/ghcide#r443383239

* Change recomp to direct cradle

Co-authored-by: Zubin Duggal <[email protected]>
Co-authored-by: Moritz Kiefer <[email protected]>
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Add test for inconsistent diagnostics

* Refactoring ModIfaceFromDisk

This started as a pure refactoring to clarify the responsibilities between
ModIface and ModIfaceFromDisk, but ended up having some behaviour changes:

1. Regenerate interface when checkOldIface returns something other than
UpToDate. This was a bug.

2. Do not generate a diagnostic when regenerating an interface.

2. Previously we conflated stale interface with other errors,
and would regenerate in both cases. Now we only regenerate in the first case.

Tentative fix for haskell/ghcide#597

* Split interface tests

* Always recompile modules with TH splices

Tentative fix for haskell/ghcide#614

TODO support stability

* Fix expectDiagnostics in MacOs

* Avoid File does not exist diagnostics for interface files

Fixes haskell/ghcide#642

* Clarify interface tests

* hlints

* Performance fixes

The previous changes were 10X slower, this is 20X faster than those, so 2X
faster than upstream, for some benchmarks

* formatting

* Fix GetModificationTime identity

The answer for a GetModification query is independent of the missingFileDiagnostics field
(as the diagnostics are not part of the answer)

* remove stale comment

* Avoid calling ghcSessionDepsDefinition twice

* Apply suggestions from code review

Co-authored-by: Moritz Kiefer <[email protected]>

* Code review feedback

* Address review feedback

https://github.com/digital-asset/ghcide/pull/645/files/49b0d9ac65399edf82a7a9cbbb8d8b5420458d8dhaskell/ghcide#r443383239

* Change recomp to direct cradle

Co-authored-by: Zubin Duggal <[email protected]>
Co-authored-by: Moritz Kiefer <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants