Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support incremental document updates #1141

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
84d4bf2
Initial work on support incremental updates
david-driscoll Mar 8, 2019
11b4bbe
Merge branch 'master' of github.com:vuejs/vetur
david-driscoll Mar 8, 2019
9d321fe
Fixed linting error
david-driscoll Mar 8, 2019
396f829
flow document info through where textdocument used to be. Fixed issu…
david-driscoll Mar 8, 2019
fe9d7b8
make DocumentInfo a TextDocument; Simplified logic for incremental co…
david-driscoll Mar 8, 2019
5ba9c7d
Updated
david-driscoll Mar 8, 2019
3300b0e
fixed some of the tests to avoid issues when running on windows
david-driscoll Mar 9, 2019
f05ca8f
Updated service host to create the underlying documents correctly
david-driscoll Mar 9, 2019
432084a
fixed diagnostic tests
david-driscoll Mar 9, 2019
cb7f4b7
clean up some commented out code
david-driscoll Mar 9, 2019
04cae09
Updated to better deal with external documents
david-driscoll Apr 1, 2019
7cd9643
simplified external documents removing content
david-driscoll Apr 1, 2019
2f7cc02
Merge remote-tracking branch 'origin/master' into incremental-updates
david-driscoll Apr 1, 2019
dc94ed5
Fixed remaining compiler errors
david-driscoll Apr 1, 2019
618f6e0
fix last compiler issues
david-driscoll Apr 2, 2019
4bee21b
Merge remote-tracking branch 'origin/master' into incremental-updates
david-driscoll Apr 2, 2019
d595b7b
improved performance by caching snapshots with documents
david-driscoll Apr 17, 2019
483eb97
Re-renable skipped tests
david-driscoll Apr 17, 2019
11d3dc5
Merge remote-tracking branch 'origin/master' into incremental-updates
david-driscoll Apr 17, 2019
476a296
Fixed changes to update to latest from origin
david-driscoll Apr 17, 2019
fa0d8f2
rollback some test changes
david-driscoll Apr 18, 2019
1e88c79
minor change
david-driscoll May 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ docs/.vuepress/dist

.nyc_output
coverage.lcov
*.7z
*.tsbuildinfo
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"type": "node",
"request": "attach",
"port": 6005,
"timeout": 60000,
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/server/dist/**/*.js"],
"protocol": "inspector",
Expand Down
65 changes: 64 additions & 1 deletion client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,74 @@ export function initializeLanguageClient(vlsModulePath: string): LanguageClient
debug: { module: serverPath, transport: TransportKind.ipc, options: debugOptions }
};

const watcher = (() => {
const innerWatcher = vscode.workspace.createFileSystemWatcher('{**/*.js,**/*.ts}', true, true, true);
return {
get ignoreCreateEvents() {
return innerWatcher.ignoreCreateEvents;
},
set ignoreCreateEvents(v) {
innerWatcher.ignoreCreateEvents = v;
},
get ignoreChangeEvents() {
return innerWatcher.ignoreChangeEvents;
},
set ignoreChangeEvents(v) {
innerWatcher.ignoreChangeEvents = v;
},
get ignoreDeleteEvents() {
return innerWatcher.ignoreDeleteEvents;
},
set ignoreDeleteEvents(v) {
innerWatcher.ignoreDeleteEvents = v;
},
onDidCreate(listener: (e: vscode.Uri) => any, thisArgs?: any, disposables?: vscode.Disposable[]) {
innerWatcher.onDidChange(
function(v: vscode.Uri) {
if (v.fsPath.includes('/node_modules/')) {
return;
}
listener(v);
},
thisArgs,
disposables
);
},
onDidChange(listener: (e: vscode.Uri) => any, thisArgs?: any, disposables?: vscode.Disposable[]) {
innerWatcher.onDidChange(
function(v: vscode.Uri) {
if (v.fsPath.includes('/node_modules/')) {
return;
}
listener(v);
},
thisArgs,
disposables
);
},
onDidDelete(listener: (e: vscode.Uri) => any, thisArgs?: any, disposables?: vscode.Disposable[]) {
innerWatcher.onDidChange(
function(v: vscode.Uri) {
if (v.fsPath.includes('/node_modules/')) {
return;
}
listener(v);
},
thisArgs,
disposables
);
},
dispose() {
innerWatcher.dispose();
}
} as vscode.FileSystemWatcher;
})();

const clientOptions: LanguageClientOptions = {
documentSelector,
synchronize: {
configurationSection: ['vetur', 'emmet', 'html', 'javascript', 'typescript', 'prettier', 'stylusSupremacy'],
fileEvents: vscode.workspace.createFileSystemWatcher('{**/*.js,**/*.ts}', false, false, true)
fileEvents: watcher
},
initializationOptions: {
config
Expand Down
Loading