mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-28 13:56:50 +01:00
For #159805 This splits the markdown server into two main functions: - `startVsCodeServer` which assumes the client can implement all the functionality of VS Code. It is not specific to VS Code however, the client just need to implement the custom messages that VS Code does - `startServer` which lets you pass in your own implementation of the parser and workspace. A consumer of the server can then use this to have their own custom server implementation, which might use normal node apis to read files
17 lines
813 B
TypeScript
17 lines
813 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
import { URI, Utils } from 'vscode-uri';
|
|
import { LsConfiguration } from '../config';
|
|
|
|
export function looksLikeMarkdownPath(config: LsConfiguration, resolvedHrefPath: URI) {
|
|
return config.markdownFileExtensions.includes(Utils.extname(resolvedHrefPath).toLowerCase().replace('.', ''));
|
|
}
|
|
|
|
export function isMarkdownFile(document: TextDocument) {
|
|
return document.languageId === 'markdown';
|
|
}
|