Skip to content

Commit

Permalink
add trace server config option
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonfan committed Jan 19, 2019
1 parent 4677842 commit 78b15a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coc-phpls",
"version": "1.0.3",
"version": "1.0.4",
"description": "PHP language server extension for coc.nvim",
"main": "lib/index.js",
"publisher": "marlonfan",
Expand Down Expand Up @@ -33,6 +33,11 @@
"type": "boolean",
"default": true,
"description": "is enable php lsp"
},
"phpls.trace.server": {
"type": "string",
"default": "",
"description": "enable phpls server trace log?"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ export async function activate(context: ExtensionContext): Promise<void> {
initializationOptions: {}
}

let client = new LanguageClient('php', 'PHP Language Server', serverOptions, clientOptions)
let client = new LanguageClient('phpls', 'PHP Language Server', serverOptions, clientOptions)

subscriptions.push(
services.registLanguageClient(client)
)

setTimeout(() => {
client.onReady().then(async () => {
WorkspaceDiscovery.client = client

fsWatcher.onDidDelete(onDidDelete);
Expand All @@ -63,7 +63,7 @@ export async function activate(context: ExtensionContext): Promise<void> {

let startedTime: Date

readAllFile(workspace.rootPath)
return await readAllFile(workspace.rootPath)
.then(files => files.map(file => Uri.file(file)))
.then(uriArray => {
let token: CancellationToken;
Expand All @@ -75,7 +75,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
let usedTime: number = Math.abs(new Date().getTime() - startedTime.getTime())
workspace.showMessage("Indexed php files, times: " + usedTime + "ms");
})
}, 1000)
})
}

function onDidDelete(uri: Uri) {
Expand Down

0 comments on commit 78b15a0

Please sign in to comment.