Comments (13)
I don't think this is technically an issue with scry
. I think this issue falls on intellij-lsp
. It looks to me that intellij-lsp
is not in compliance with the protocol. Once they are compliant scry
should work.
from scry.
Is it true that this isn't a scry problem? Which part of that message are we failing on? According to the 3.0 spec, many of those fields (hover, etc) should be optional. Which means the intellij message may be valid and scry isn't compliant.
from scry.
/cc @crystal-lang-tools/scry
from scry.
Seems the initialize
message sended by intellij-idea client is a bit different:
- Message sent by a working client (VSCode)
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"processId": 8075,
"rootPath": "/home/main/Projects/console",
"rootUri": "file:///home/main/Projects/console",
"capabilities": {
"workspace": {
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true
},
"executeCommand": {
"dynamicRegistration": true
}
},
"textDocument": {
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"completionItem": {
"snippetSupport": true
}
},
"hover": {
"dynamicRegistration": true
},
"signatureHelp": {
"dynamicRegistration": true
},
"definition": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true
},
"codeAction": {
"dynamicRegistration": true
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true
},
"documentLink": {
"dynamicRegistration": true
}
}
},
"trace": "off"
}
}
- Message sent by intellij LSP client (extracted from this issue)
{
"jsonrpc": "2.0",
"id": "1",
"method": "initialize",
"params": {
"rootUri": "file:///api_v2/",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true
},
"didChangeWatchedFiles": {},
"symbol": {},
"executeCommand": {}
},
"textDocument": {
"synchronization": {
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"completionItem": {
"snippetSupport": false
}
},
"hover": {},
"signatureHelp": {},
"references": {},
"documentHighlight": {},
"formatting": {},
"rangeFormatting": {},
"onTypeFormatting": {},
"definition": {},
"codeAction": {},
"rename": {}
}
}
}
}
from scry.
/cc @gtache
from scry.
@kofno I think you're right, looking back it it.
Here's the TypeScript definition in the spec for hover
:
/**
* Capabilities specific to the `textDocument/hover`
*/
hover?: {
/**
* Whether hover supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Client supports the follow content formats for the content
* property. The order describes the preferred format of the client.
*/
contentFormat?: MarkupKind[];
};
Given this it looks like valid values for the hover field would include hover: undefined
, hover: null
, hover: {}
, and hover: { dynamicRegistration: true }
.
from scry.
@keplersj agreed. We should fix.
from scry.
So I just went to see how we've mapped the schema for capabilities and we have capabilities mapped to JSON::Any
https://github.com/crystal-lang-tools/scry/blob/master/src/scry/protocol/initialize_params.cr#L8
So I'm not so sure capabilities is the problem anymore. It looks like our mapping of processId
and rootPath
is incorrect.
/**
* The process Id of the parent process that started
* the server. Is null if the process has not been started by another process.
* If the parent process is not alive then the server should exit (see exit notification) its process.
*/
processId: number | null;
/**
* The rootPath of the workspace. Is null
* if no folder is open.
*
* @deprecated in favour of rootUri.
*/
rootPath?: string | null;
https://github.com/crystal-lang-tools/scry/blob/master/src/scry/protocol/initialize_params.cr#L6-L7
from scry.
Hi @Blacksmoke16 We merged a PR to fix InitializeParams
🎉
Can you test it again in your Intellij-Idea IDE?
You will need to compile scry from master branch, try this:
git clone https://github.com/crystal-lang-tools/scry.git
cd scry
mkdir bin
crystal build --status --progress src/scry.cr -o bin/scry
from scry.
Any updates on this?
from scry.
Oh I totally forgot about this. I can check it when i get home tonight.
from scry.
@faustinoaq @maltevoos I tried this again but same error. I used the latest release binary. I don't remember where the logs for this get outputted to tho....
from scry.
@Blacksmoke16 Sorry, I meant to ask the devs if they could look into this once more because I had the same issue with the latest release.
from scry.
Related Issues (20)
- test failure with latest commit on master and crystal 0.26 HOT 5
- `flag?` crashes compiler HOT 4
- https://github.com/crystal-lang/crystal/issues/7151 HOT 6
- This library should have a set of benchmarks HOT 1
- What unit does scry use in lsp ranges HOT 1
- Building gives `undefined constant Crystal::Codegen::Target` error HOT 12
- Extract LSP protocol to a shard? HOT 2
- Stop depending on the real stdlib for our specs
- Speedup by going full async and manage tasks intelligently HOT 1
- Debug idea: use lsp-inspector
- Prelude Error Message HOT 2
- Completion fails using Emacs and lsp-mode
- Incorrect path reference
- specs failing... HOT 1
- Is the project abandoned? HOT 4
- Fails to build with crystal 0.36 HOT 1
- Broken JSON-RPC message HOT 3
- Build failure on master branch, Crystal 1.0.0; dependency resolution problem. HOT 1
- Can't build with Crystal 1.3.2 (Error: no overload matches 'Crystal.exit' with types Int32) HOT 3
- scry starts itself up and take over 3 gigs of memory
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 scry.