Comments (8)
Hi @vincentLiuxiang, could you be more specific what does not follow the LSP?
from monaco-languageclient.
@akosyakov
You can look at the red square inside the pictures.
textDocument/didChange
In LSP, when the method is textDocument/didChange
, the params must be DidChangeTextDocumentParams
interface DidChangeTextDocumentParams {
/**
* The document that did change. The version number points
* to the version after all provided content changes have
* been applied.
*/
textDocument: VersionedTextDocumentIdentifier;
/**
* The actual content changes. The content changes describe single state changes
* to the document. So if there are two content changes c1 and c2 for a document
* in state S10 then c1 move the document to S11 and c2 to S12.
*/
contentChanges: TextDocumentContentChangeEvent[];
}
/**
* An event describing a change to a text document. If range and rangeLength are omitted
* the new text is considered to be the full content of the document.
*/
interface TextDocumentContentChangeEvent {
/**
* The range of the document that changed.
*/
range?: Range;
/**
* The length of the range that got replaced.
*/
rangeLength?: number;
/**
* The new text of the range/document.
*/
text: string;
}
but monaco-languageclient
send data to sever like this:
{
"method": "textDocument/didChange",
"params": {
"contentChanges": [
{ "text": "{↵ "$schema": "http://json.schemastore.org/coffeelint",↵ "line_endings": "unix"↵}aaa" }
]
}
}
the difference is in contentChanges
.
from monaco-languageclient.
It depends on a language server, the json server used in the example is not able to handle incremental changes, so the client always sends the whole document. A server can communicate it as a part of exchanging initialization capabilities. Look for TextDocumentSyncKind
in the specification.
from monaco-languageclient.
monaco-languageclient
theia-ide
from monaco-languageclient.
so, if My server support handle incremental changes, I can get the same result like the theia-ide?
what's more could you give an example that is closer to the production environment? java, js and so on?
from monaco-languageclient.
@akosyakov I am very new in LSP, I have Look for TextDocumentSyncKind in the specification. Thank you very much!
from monaco-languageclient.
@vincentLiuxiang You are welcome, I am closing it.
from monaco-languageclient.
I know this issue has been closed but I saw the screen shot, there is a "Content-Length: 25x" at the beginning of the data return by web-socket which as same as my project which use the language server provide by monaco-languageclient. This "Content-Length" will cause an error at language server side. But I didn't see it in the example given by monaco-languageclient. I'm wondering why I have this "Content-Length" and will it crash the hole process?
from monaco-languageclient.
Related Issues (20)
- Large bundle size HOT 8
- wrapper.dispose() does not get rid of extension HOT 4
- MonacoEditorReactComp throws "You cannot update the code resources as neither editor or diff editor is available." HOT 1
- MonacoEditorReactComp not updating onTextChanged callback
- this._configurationService.onDidChangeConfiguration is not a function HOT 3
- Theme not loading and worker not being created HOT 17
- feature: Support for the Debug Adapter Protocol HOT 7
- resolve vscode error in browser env HOT 1
- Typescript incorrect type highlighting HOT 28
- MonacoEditorReactComp not fires onTextChanged callback if you change code resource HOT 4
- init error HOT 1
- Module not found: Can't resolve 'monaco-languageclient/vscode/services' HOT 6
- Auto completion with PHP doesn't work as expected HOT 7
- onDidChangeConfiguration is not a function error in both `wrapper-react` and standard use. HOT 4
- nextjs + electronjs HOT 4
- Empty file exploler in sidebar HOT 3
- auto-complete doesn't work HOT 4
- 'vscode-languageclient/lib/common/client.js' doesn't provide an export named: 'BaseLanguageClient' HOT 2
- Question about using monaco-vscode-editor-api vs monaco-editor for LSP Integration HOT 7
- Dynamically change theme HOT 8
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 monaco-languageclient.