Skip to content

Commit ad9675f

Browse files
authored
Scaffold out basic markdown language server (microsoft#154293)
* Scaffold out basic markdown lsp This scaffolds out a new markdown language server and then uses it to implement document symbols. After the change, the markdown extension will have the following structure: - languageService — Where all the LSP language stuff will eventually land - server — The actual language server. Consumes ` languageService` - src — The current extension that launches the server and implements VS Code specific functions * Adding build scripts * a * Use language service from github * Remove ls build scripts * Bump versions * Only build ext * Enable for web * Fixing for browser
1 parent 3d3bfce commit ad9675f

27 files changed

+626
-151
lines changed

build/azure-pipelines/darwin/product-build-darwin-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ steps:
4646
compile-extension:html-language-features-server \
4747
compile-extension:ipynb \
4848
compile-extension:json-language-features-server \
49+
compile-extension:markdown-language-features-server \
4950
compile-extension:markdown-language-features \
5051
compile-extension-media \
5152
compile-extension:microsoft-authentication \

build/azure-pipelines/linux/product-build-linux-client-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ steps:
5858
compile-extension:html-language-features-server \
5959
compile-extension:ipynb \
6060
compile-extension:json-language-features-server \
61+
compile-extension:markdown-language-features-server \
6162
compile-extension:markdown-language-features \
6263
compile-extension-media \
6364
compile-extension:microsoft-authentication \

build/azure-pipelines/win32/product-build-win32-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ steps:
5252
compile-extension:html-language-features-server `
5353
compile-extension:ipynb `
5454
compile-extension:json-language-features-server `
55+
compile-extension:markdown-language-features-server `
5556
compile-extension:markdown-language-features `
5657
compile-extension-media `
5758
compile-extension:microsoft-authentication `

build/gulpfile.extensions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const compilations = [
5353
'json-language-features/client/tsconfig.json',
5454
'json-language-features/server/tsconfig.json',
5555
'markdown-language-features/preview-src/tsconfig.json',
56+
'markdown-language-features/server/tsconfig.json',
5657
'markdown-language-features/tsconfig.json',
5758
'markdown-math/tsconfig.json',
5859
'merge-conflict/tsconfig.json',

build/npm/dirs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ exports.dirs = [
2828
'extensions/jake',
2929
'extensions/json-language-features',
3030
'extensions/json-language-features/server',
31+
'extensions/markdown-language-features/server',
3132
'extensions/markdown-language-features',
3233
'extensions/markdown-math',
3334
'extensions/merge-conflict',

extensions/markdown-language-features/extension-browser.webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const withBrowserDefaults = require('../shared.webpack.config').browser;
1212
module.exports = withBrowserDefaults({
1313
context: __dirname,
1414
entry: {
15-
extension: './src/extension.ts'
15+
extension: './src/extension.browser.ts'
1616
}
1717
}, {
1818
configFile: 'tsconfig.browser.json'

extensions/markdown-language-features/extension.webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ module.exports = withDefaults({
1515
mainFields: ['module', 'main']
1616
},
1717
entry: {
18-
extension: './src/extension.ts',
18+
extension: './src/extension.node.ts',
1919
}
2020
});

extensions/markdown-language-features/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"engines": {
1111
"vscode": "^1.20.0"
1212
},
13-
"main": "./out/extension",
13+
"main": "./out/extension.node",
1414
"browser": "./dist/browser/extension",
1515
"categories": [
1616
"Programming Languages"
@@ -534,8 +534,8 @@
534534
]
535535
},
536536
"scripts": {
537-
"compile": "gulp compile-extension:markdown-language-features && npm run build-preview && npm run build-notebook",
538-
"watch": "npm run build-preview && gulp watch-extension:markdown-language-features",
537+
"compile": "gulp compile-extension:markdown-language-features-languageService && gulp compile-extension:markdown-language-features-server && gulp compile-extension:markdown-language-features && npm run build-preview && npm run build-notebook",
538+
"watch": "npm run build-preview && gulp watch-extension:markdown-language-features watch-extension:markdown-language-features-languageService watch-extension:markdown-language-features-server",
539539
"vscode:prepublish": "npm run build-ext && npm run build-preview",
540540
"build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json",
541541
"build-notebook": "node ./esbuild-notebook",
@@ -551,6 +551,7 @@
551551
"markdown-it-front-matter": "^0.2.1",
552552
"morphdom": "^2.6.1",
553553
"picomatch": "^2.3.1",
554+
"vscode-languageclient": "^8.0.1",
554555
"vscode-languageserver-textdocument": "^1.0.4",
555556
"vscode-nls": "^5.0.0",
556557
"vscode-uri": "^3.0.3"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": "0.1.0",
3+
// List of configurations. Add new configurations or edit existing ones.
4+
"configurations": [
5+
{
6+
"name": "Attach",
7+
"type": "node",
8+
"request": "attach",
9+
"port": 6044,
10+
"protocol": "inspector",
11+
"sourceMaps": true,
12+
"outFiles": ["${workspaceFolder}/out/**/*.js"]
13+
},
14+
{
15+
"name": "Unit Tests",
16+
"type": "node",
17+
"request": "launch",
18+
"program": "${workspaceFolder}/../../../node_modules/mocha/bin/_mocha",
19+
"stopOnEntry": false,
20+
"args": [
21+
"--timeout",
22+
"999999",
23+
"--colors"
24+
],
25+
"cwd": "${workspaceFolder}",
26+
"runtimeExecutable": null,
27+
"runtimeArgs": [],
28+
"env": {},
29+
"sourceMaps": true,
30+
"outFiles": ["${workspaceFolder}/out/**/*.js"]
31+
}
32+
]
33+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "0.1.0",
3+
"command": "npm",
4+
"isShellCommand": true,
5+
"showOutput": "silent",
6+
"args": ["run", "watch"],
7+
"isWatching": true,
8+
"problemMatcher": "$tsc-watch"
9+
}

0 commit comments

Comments
 (0)