Comments (3)
This is something I'd love to discuss. As ever there are pros and cons.
The pro is that LSP configuration gets a lot easier. Also, because the compiler is integrated, we don't have to spawn a process and endure its associated overhead. and we can also avoid the bodge of piping in on stdin.
The cons for me are several. First, the editor extension is locked to a particular version of the compiler and needs to be rebuilt with each release. Also, you could end up with a different compiler version on your CLI to what the editor is using, which could lead to different compiler errors/warnings from the CLI and the editor. Is this what you address with the Grain source setup when you link the ocaml-lsp?
It always confused me in the Reason world when warned not to run the compiler in watch mode and have the Reason LSP running as both then compile at the same time. I'd like to try and avoid that (a separate issue).
Finally, I want to make the LSP less VS Code specific and more generic LSP. That requires a bunch more thinking about.
Just jotting down some thoughts, feedback welcome
from grain-language-server.
Some more thoughts on this now that I'm starting to work on Go to definition/type declaration/implementation.
A lot of what I need is queryable from the AST. There's a lot of overhead in parsing, converting the AST, passing it over an RPC bridge as JSON, decoding. I'm also pre-querying the definition location of functions, types etc. This is a lot of work done that is often thrown away.
I'd love to have the AST and the Grain libraries like Env.* available in the LSP server. As a half way house I'm pondering just sending the AST and using the JSOO-ed Grain files I need to parse it.
from grain-language-server.
Going to close this, as #100 solves it in a much better way.
from grain-language-server.
Related Issues (20)
- Add highlighting for true/false constants in pattern matching
- Add highlighting for or-patterns
- Accept a string of flags to pass to the `grain lsp` command
- Division Symbol Getting Recognized As Comment
- Syntax Highlighting messes up on inline block statement
- Add Highlighting For `Infinity` and `NaN` syntax
- Highlighting Issue With Export
- Add support for coalescing operator
- Fix highlighting of infix operators with double slash
- Highlight number suffixes differently than the number
- Syntax Highlighting is bad in lemire.gr
- Syntax Highlighting messes up `assert` followed by a parenthesis expr
- Syntax: Add Floating Point Hex Exponents to syntax highlighting HOT 1
- Syntax: Syntax highlighting gets a little messed up when you use an inline function like `List.map`
- Feature Request: Regen File Errors On Refocus HOT 1
- Syntax Highlighting messes up on record attached to enum HOT 2
- Toggle For Inlay Hints
- Refactor how we locate the Grain executable
- Add highlighting for future type syntax HOT 1
- Handle multi root folder workspaces properly for compile script
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 grain-language-server.