Merge VSCode extension from pony-language-server repo#2
Merge VSCode extension from pony-language-server repo#2SeanTAllen merged 34 commits intoponylang:mainfrom
Conversation
* Prepare preparing a release * Fix some vulns in js dependencies
* Properly set textDocumentSync properties of the serverCapabilities in order to make the LSP work in neovim * Add release notes * Add publisher to vscode extension package.json as demanded by vsce, the extension packaging and publishing tool
…ongs to * Use loaded packages from compilation result, not packages listed in corral.json files otherwise we miss out on nested packages. TODO: also allow stdlib packages, which are outside of the current workspace. * Ensure the lsp finds documents in all its compiled packages not just in ones being contained within the workspace * Update webpack to a safe version
npm audit fix Co-authored-by: iacore <noreply+gpg-stub@1a-insec.net>
3b84f31 to
0c31ee0
Compare
Makefile
Outdated
| @@ -0,0 +1,36 @@ | |||
| PONY_VERSION := 0.58.4 | |||
There was a problem hiding this comment.
This contains stuff for the lsp. We definitely don't want to bring that over.
| @@ -0,0 +1,78 @@ | |||
| { | |||
There was a problem hiding this comment.
a lot of this looks incorrect at this point.
There was a problem hiding this comment.
Yeah, it's just a straight copy of the code at this point.
There's still plenty of configuration updates and testing needed before this PR will come out of draft.
There was a problem hiding this comment.
A copy of the client_vscode directory, minus the client_vscode/packages directory - just to be clear.
|
FYI, this will all get squashed down to a single commit. If there are specific people who should be mentioned in the commit for "prior work", please let me know so they can be put in. |
I think that's fine. GitHub should include all the commit authors in the default squash commit message. |
| // If the extension is launched in debug mode then the debug server options are used | ||
| // Otherwise the run options are used | ||
| let serverOptions: ServerOptions = { | ||
| command: "pony-lsp", |
There was a problem hiding this comment.
Run pony-lsp as found on the path. Previously, pony-lsp was packaged in the extension.
| "pony.ponyStdLibPath": { | ||
| "scope": "window", | ||
| "type": "string", | ||
| "default": "", | ||
| "description": "Path to the Pony standard library packages directory. If not set, pony-lsp will try to auto-detect it." | ||
| } |
There was a problem hiding this comment.
pony-lsp needs the Pony standard library on the PONYPATH. Create an configuration option for Visual Studio Code users to specify the path to their ponyc installation.
There was a problem hiding this comment.
Was the lsp not updated to search for the standard library the same as ponyc?
is this for "if I can't find the lsp, tell me where it is?"
There was a problem hiding this comment.
This is "if the LSP can't find the standard library, specify where it is".
I'm not familiar with the specifics of that change though. @mfelsche?
On my system the LSP cannot find the standard library. It raises errors like this:
[Debug - 19:09:06] done compiling /Users/orien/src/orien/ponyc/tools/pony-lsp/test/workspace
[Trace - 19:09:06] Received notification 'window/logMessage'.
Params: {
"message": "Compilation failed with 1 errors",
"type": 5
}
[Debug - 19:09:06] Compilation failed with 1 errors
[Trace - 19:09:06] Received notification 'window/logMessage'.
Params: {
"message": "ERROR: couldn't locate this path in file builtin",
"type": 5
}
There was a problem hiding this comment.
Ok that needs to be implemented in the LSP. I'll post the ponyc logic in a while.
There was a problem hiding this comment.
The logic in question is in
which is from "add_pony_installation_dir":
It can be called from: package_init_lib
which i added to do what pony-lsp needs for ponydoc that is stalled. you can see it in:
bool ponydoc_init(pass_opt_t* options, const char* pony_installation) in ponydoc.c
|
@orien I take it from the change in status that this is ready for merging? |
|
@SeanTAllen Yes, I think it's good to merge. I'm happy to address feedback though. |
|
I'm going to merge and if there is feedback, we can address that going forward. |
In preparation for archiving the pony-language-server GitHub repository, move the VSCode extension source code into this dedicated repository.
For transparency, these are the changes I made on top of the copied code:
Details