:bangbang: Please note, this product is still in alpha.
VSCode.NET is a Visual Studio Code language server for .NET/.NET Core. It is designed to be fully compliant with the language server protocol and compatible with Microsoft's NodeJS language server client implementation.
Creating a language server using VSCode.NET is pretty simple:
Create a new VS Code extension based on the language server example outlined in the VS Code documentation.
In extension.ts
, change the contents of the activate(context: ExtensionContext)
function to the following (making changes as needded for your extension):
export function activate(context: ExtensionContext) {
let clientOptions: LanguageClientOptions = {
documentSelector: ['plaintexet'],
synchronize: {
configurationSection: 'yourConfigSection',
fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
}
};
let disposable = new LanguageClient('VSCode.NET', {
command: 'path/to/your/server/executable.exe'
}, clientOptions).start();
}
Create a new .NET or .NET Core project and reference the VSCode
package.
Spin up a language server:
using VSCode;
using VSCode.Editor;
namespace MyApp
{
class Program
{
static void Main()
{
using (LanguageServer server = new LanguageServer())
{
server.Start();
server.WaitForState(LanguageServerState.Started);
server.Editor.ShowMessage(MessageType.Info, "Hello from .NET!");
}
}
}
}
Read the API Documentation to learn more!
Can I use this for my VS Code extension?
Of course! It should be noted, however, that VSCode.NET is currently in the early alpha stages. Breaking changes to the API could happen until things mature a bit.
What operating systems are supported?
.NET 4.5/4.5.1/4.5.2
or .NET Core 1.0
).NET Core 1.0
).NET Core 1.0
)