LSP for IntelliJ/PHPStorm #997
-
|
I spotted the LSP in the changelog and got curious.
I'd be interested in an IntelliJ version for it. I installed the following IntelliJ plugin https://github.com/redhat-developer/lsp4ij and then tried to define it: But apart from a small notification The logs only showed:
I guess I need to hand in more configuration for the Server or Client side, but I was unable to spot anything in https://github.com/zizmorcore/zizmor-vscode/blob/main/src/extension.ts that I should be copying. Or is it in the typescript dependency and you simply didn't need to change anything? Would you be able to share the JSON of server configuration, initialization options and client configuration that the VSCode version is creating? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 1 reply
-
|
@nickvergessen I am the author of LSP4IJ. I am not sure that you can define file pattern with / since it uses the same class used in intellij when you define file type. Could you just define *.yml in your file pattern. |
Beta Was this translation helpful? Give feedback.
-
@nickvergessen if you need to know which configuration settings initializations options expexted by the language server I suggest that you install the vscide extension and defines |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot @angelozerr that was way easier then expected: It seems to work now |
Beta Was this translation helpful? Give feedback.
-
Thzts great! I wonder if it could be interesting to add your server definition as templzte in lsp4ij https://github.com/redhat-developer/lsp4ij/blob/main/docs%2FUserDefinedLanguageServerTemplate.md And if you like LSP4IJ please add a review in jetbrzins marketplace to help us to promote it. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
I will test it a bit more, but it really looks quite "easy". I exported the server, all files are empty but the {
"name": "zizmor - Static analysis for GitHub Actions ",
"programArgs": {
"default": "zizmor --lsp"
},
"fileTypeMappings": [
{
"fileType": {
"patterns": [
"*.yml"
]
},
"languageId": "yaml"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
|
Indeed it should be easy to do and it is the reason why I think it could be a good idea to have a template. Please read the doc because for instance you need to define an id in your templzte.json More i suggest that yiu write 1n installer.json to install the server automaticly. I suggest that you see the templates/lsp user defined ls. By adding your ls as template you will have an exitor notification which will promote to install the server. See for instance zstro doc at https://github.com/redhat-developer/lsp4ij/blob/main/docs%2Fuser-defined-ls%2Fastro-ls.md |
Beta Was this translation helpful? Give feedback.
-
|
Hey @nickvergessen, thanks for opening! And thank you @angelozerr for diagnosing! For future reference, the relevant document selector configuration is here: ...and also here in the LSP server itself, although I'm guessing in this case LSP4IJ doesn't allow the server to declare its capabilities like this: zizmor/crates/zizmor/src/lsp.rs Lines 50 to 116 in 1cc8f93 More generally, I'd recommend constraining your configuration like one of the above, since matching |
Beta Was this translation helpful? Give feedback.
-
|
NB: I'm moving this over to a discussion for now, but I'd be happy to take a doc PR that updates the LSP integrations section to mention IntelliJ 🙂 |
Beta Was this translation helpful? Give feedback.





@nickvergessen I am the author of LSP4IJ.
I am not sure that you can define file pattern with / since it uses the same class used in intellij when you define file type.
Could you just define *.yml in your file pattern.