LspSocketConfig class
A configuration class for Language Server Protocol (LSP) using WebSocket communication.
Documenation available here.
Example: create a LspSocketConfig object and pass it to the CodeCrafter widget.
final lspConfig = LspSocketConfig(
filePath: '/home/athul/Projects/lsp/example.py',
workspacePath: "/home/athul/Projects/lsp",
languageId: "python",
serverUrl: "ws://localhost:5656"
),
Then pass the lspConfig instance to the CodeCrafter widget:
CodeCrafter(
controller: controller,
theme: anOldHopeTheme,
lspConfig: lspConfig, // Pass the LSP config here
),
Constructors
Properties
- disableError → bool
-
Whether to disable errors from the LSP server.
finalinherited
- disableWarning → bool
-
Whether to disable warnings from the LSP server.
finalinherited
- filePath → String
-
The file path of the document to be processed by the LSP.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- languageId → String
-
The language ID of the language.
finalinherited
-
responses
→ Stream<
Map< String, dynamic> > -
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverUrl → String
-
The URL of the LSP server to connect to via WebSocket.
final
- workspacePath → String
-
The workspace path of the document to be processed by the LSP.
finalinherited
Methods
-
closeDocument(
) → Future< void> -
Updates the document in the LSP server if there is any change.
///
This method is used internally by the CodeCrafter widget and calling it directly is not recommended.
inherited
-
connect(
) → Future< void> - This method is used to initialize the LSP server. and it's used internally by the CodeCrafter widget. Calling it directly is not recommended and may crash the LSP server if called multiple times.
-
dispose(
) → void -
override
-
getCompletions(
int line, int character) → Future< List< LspCompletion> > -
This method is used to get completions at a specific position in the document.
inherited
-
getDefinition(
int line, int character) → Future< String> -
inherited
-
getHover(
int line, int character) → Future< String> -
This method is used to get details at a specific position in the document.
inherited
-
getReferences(
int line, int character) → Future< List> -
inherited
-
initialize(
) → Future< void> -
This method is used to initialize the LSP server.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openDocument(
) → Future< void> -
Opens the document in the LSP server.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateDocument(
String content) → Future< void> -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited