Comments (6)
You know it would be more useful if that error message specified what the expected path was - I assume that either this is wrong, or there is some path normalisation of some kind getting in the way.
Can you post further logs? If I'm reading the code right there should be an info message just prior to that error which contains the other piece of information
from purescript-language-server.
These are all the log lines coming from LanguageClient
before starting the server.
[LC] Project root: /Users/******/Projects/purescript-**********
[LC] [Info] Starting IDE server
[LC] [Log] PureScript Language Server started
[LC] [Info] {"capabilities":{"textDocument":{"colorProvider":null,"completion":{"completionItem":{"snippetSupport":false}},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupp
ort":true}}}},"workspace":{"applyEdit":true,"didChangeWatchedFiles":{"dynamicRegistration":true}}},"processId":89536,"rootPath":"/Users/*****/Projects/purescript-**********","rootUri":"file:///Users/*****/Projects/purescript-**********","trace":"verbose"}
[LC] [Log] Starting with args: ["/Users/*****/.nvm/versions/node/v13.11.0/bin/node","/usr/local/bin/purescript-language-server","--stdio","--config","{\"purescript\": {\"pscIdePort\": null, \"autoStartPs
cIde\": true, \"pursExe\": \"purs\", \"addNpmPath\": true, \"autocompleteAddImport\": true}}"]
[LC] [Log] Starting with cwd: /Users/*****/Projects/purescript-********** and using root path: /Users/*****/Projects/purescript-**********
[LC] [Info] Resolved IDE server paths (npm-bin: true) from PATH of node_modules/.bin:/usr/local/sbin:/Users/*****/.gem/ruby/2.6.0/bin:/usr/local/opt/ruby/bin:/Users/*****/.nvm/versions/nod
e/v13.11.0/bin:/Users/*****/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/Users/*****/.gem/ruby/2.6.0/bin:/usr/local/opt/ruby/bin:/Users/*****/.nvm/vers
ions/node/v13.11.0/bin:/Users/*****/bin:/Users/*****/Library/Android/sdk/build-tools/:/Users/*****/Library/Android/sdk/platform-tools/:/Users/*****/Library/Android/sdk/tools/:/Users/*****/Library/And
roid/sdk/build-tools/:/Users/*****/Library/Android/sdk/platform-tools/:/Users/*****/Library/Android/sdk/tools/ (1st is used):
[LC] [Info] node_modules/.bin/purs: 0.12.5
[LC] [Info] Starting IDE server on port 8898 with cwd
[LC] [Error] Found existing IDE server on port '8898' with wrong path: '/Users/*****/Projects/purescript-**********'. Correct, kill or configure a different port, and restart.
I can confirm that all the paths are verified to the same directory. Tell me if you need any more information.
from purescript-language-server.
There's some oddness in the logging, but it seems that the expected root path is blank (where it says with cwd, there should be a path).
I think this is down to the starting of the language-server with a config object on the command line, which is different to the way eg vscode does it - this was hard to get working originally (basically VS Code always sends config immediately and the vim language client did not, making it hard to know when to start things up), I think things have changed and I can revisit it.
Basically a timing issue, because you have pre-supplied config, but that doesn't include the root path, the server is starting with blank cwd. Until I fix this, there may be some workaround:
- Restart/reconnect IDE server (I don't think this will kill your server if it wasn't the one we started)
- Don't use
autoStartPscIde
but run the start command by hand - Add the root path to that config JSON object
from purescript-language-server.
Can you explain how does VS Code pass the config? If there is a command I have to issue, I can do that. LanguageClient_NeoVim allows me to issue custom commands.
Restart/reconnect IDE server (I don't think this will kill your server if it wasn't the one we started)
I tried this. I tried with just issuing purescript.stopPscIde
and purescript.startPscIde
commands, and also by terminating the entire language client and starting it again. No luck with that. CWD is still going blank.
Don't use
autoStartPscIde
but run the start command by hand
I don't want to do that as much as possible. The commands in my wrapper are a little verbose to type at every session.
Add the root path to that config JSON object
What is the key that I should use to send it with the JSON?
from purescript-language-server.
On connection, VS Code immediately sends didChangeConfiguration
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeConfiguration
At the time of someone first trying this with a non-vscode LSP client, I added the option to instead pass a JSON object on the command line, because that client didn't automatically send config first thing - because there are some config that is only read at startup, and nothing can happen until that config is received.
In newer versions of the LSP spec the server can also request config from the client - if this is implemented it is probably worth my trying to switch to that instead.
In any case I'm going to try to push a version this weekend that at least improves the messaging here (so we can see what the conflicting config is etc), or hopefully something better.
Edit: I just looked and it seems some log lines there are just wrong - definitely worth holding off. But if you do want to try munging that JSON config object, if you take the rootUri and rootPath that is logged there already and paste those in, there is a chance that something might work.
from purescript-language-server.
I've just published a version which supports the newer workspace/configuration
message, as well as the existing client-push and command line config schemes, I believe there may be updated logging that didn't make it to a previous release too.
I'd hope any LSP implementations now will be supporting workspace/configuration
, it seems to be the way to go for the future
from purescript-language-server.
Related Issues (20)
- Support configuring spago file/target
- Neovim configuration HOT 6
- BUG: Deleting/renaming modules does NOT purge them from the cache HOT 3
- Support completion for qualified do imports
- Docs: Update formatter section HOT 1
- Organizeing imports deletes comments HOT 1
- Hover (show documentation) does not work with recent coc.nvim HOT 8
- Suggestion: Extend diagnostics on type to buffer switches HOT 1
- Support multiple spans per diagnostic
- Incorrect "Go to definition" behavior for the `Bind` data type.
- E715: Dictionary required when trying to apply sourse.sortImports code action HOT 2
- Breakpoints?
- Use with spaghetto (spago@next)
- amazing stuff; just wondering if it supports eval? like in -- >> HOT 1
- Warning/Error reporting not working? HOT 5
- Action to export HOT 1
- Find references returns no references HOT 1
- Should optional field return null? HOT 1
- Stale errors/warnings stick around after a full build
- Presence of VTA prevents LSP functionality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-language-server.