![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
typescript-language-server
Advanced tools
Language Server Protocol (LSP) implementation for TypeScript using tsserver
The typescript-language-server is an implementation of the Language Server Protocol (LSP) for TypeScript. It provides a range of features to enhance the development experience in editors and IDEs by offering functionalities like auto-completion, go-to-definition, and more.
Auto-completion
This code sets up a basic TypeScript Language Server that provides auto-completion suggestions. When the user types, the server can suggest completions like 'console.log'.
const { createConnection, TextDocuments } = require('vscode-languageserver');
const connection = createConnection();
const documents = new TextDocuments();
connection.onInitialize(() => {
return {
capabilities: {
textDocumentSync: documents.syncKind,
completionProvider: {
resolveProvider: true
}
}
};
});
connection.onCompletion(() => {
return [
{
label: 'console.log',
kind: 1,
data: 1
}
];
});
connection.listen();
Go-to-definition
This code sets up a TypeScript Language Server that provides go-to-definition functionality. When the user requests the definition of a symbol, the server responds with the location of the definition.
const { createConnection, TextDocuments } = require('vscode-languageserver');
const connection = createConnection();
const documents = new TextDocuments();
connection.onInitialize(() => {
return {
capabilities: {
textDocumentSync: documents.syncKind,
definitionProvider: true
}
};
});
connection.onDefinition((params) => {
return {
uri: params.textDocument.uri,
range: {
start: { line: 0, character: 0 },
end: { line: 0, character: 10 }
}
};
});
connection.listen();
Diagnostics
This code sets up a TypeScript Language Server that provides diagnostics. It scans the document for 'TODO' comments and reports them as warnings.
const { createConnection, TextDocuments, Diagnostic, DiagnosticSeverity } = require('vscode-languageserver');
const connection = createConnection();
const documents = new TextDocuments();
connection.onInitialize(() => {
return {
capabilities: {
textDocumentSync: documents.syncKind
}
};
});
documents.onDidChangeContent((change) => {
const diagnostics = [];
const text = change.document.getText();
const pattern = /TODO/g;
let match;
while ((match = pattern.exec(text))) {
diagnostics.push({
severity: DiagnosticSeverity.Warning,
range: {
start: change.document.positionAt(match.index),
end: change.document.positionAt(match.index + match[0].length)
},
message: `TODO found: ${match[0]}`,
source: 'ex'
});
}
connection.sendDiagnostics({ uri: change.document.uri, diagnostics });
});
connection.listen();
The vscode-json-languageserver is a Language Server Protocol implementation for JSON. It provides similar functionalities like auto-completion, go-to-definition, and diagnostics but is specifically tailored for JSON files. Compared to typescript-language-server, it is focused on JSON rather than TypeScript.
The vscode-css-languageserver-bin is a Language Server Protocol implementation for CSS. It offers features like auto-completion, go-to-definition, and diagnostics for CSS files. While typescript-language-server is for TypeScript, this package is specialized for CSS.
The vscode-html-languageserver-bin is a Language Server Protocol implementation for HTML. It provides functionalities such as auto-completion, go-to-definition, and diagnostics for HTML files. This package is similar to typescript-language-server but is designed for HTML.
Language Server Protocol implementation for TypeScript wrapping tsserver
.
Based on concepts and ideas from https://github.com/prabirshrestha/typescript-language-server.
Maintained by TypeFox and others.
textDocument/didChange (incremental)
textDocument/didClose
textDocument/didOpen
textDocument/didSave
textDocument/codeAction
textDocument/completion (incl. completion/resolve)
textDocument/definition
textDocument/documentHighlight
textDocument/documentSymbol
textDocument/executeCommand
textDocument/format
textDocument/hover
textDocument/rename
textDocument/references
textDocument/signatureHelp
workspace/symbol
npm install -g typescript-language-server
typescript-language-server --stdio
$ typescript-language-server --help
Usage: typescript-language-server [options]
Options:
-V, --version output the version number
--stdio use stdio
--node-ipc use node-ipc
--log-level A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `3`.
--socket <port> use socket. example: --socket=5000
--tsserver-logFile <tsServerLogFile> Specify a tsserver log file. example: --tsServerLogFile=ts-logs.txt
--tsserver-path <path> Specifiy path to tsserver. example: --tsserver-path=tsserver
-h, --help output usage information
yarn install
yarn build
yarn test
yarn
yarn watch
FAQs
Language Server Protocol (LSP) implementation for TypeScript using tsserver
The npm package typescript-language-server receives a total of 87,470 weekly downloads. As such, typescript-language-server popularity was classified as popular.
We found that typescript-language-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.