Skip to content

Commit 25b4e27

Browse files
committed
Formatting
1 parent c6e992e commit 25b4e27

File tree

1 file changed

+67
-65
lines changed

1 file changed

+67
-65
lines changed

src/extension.ts

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -202,23 +202,21 @@ export function activate(context: ExtensionContext) {
202202
clientConfig['clientVersion'] = VERSION
203203
let args = ['--language-server'].concat(clientConfig['launchArgs']);
204204

205-
let env: any = {}
206-
let kToFoward = [
205+
let env: any = {};
206+
let kToForward = [
207207
'ProgramData',
208208
'PATH',
209209
];
210-
for (let e of kToFoward)
211-
env[e] = process.env[e]
210+
for (let e of kToForward)
211+
env[e] = process.env[e];
212212

213213
// env.LIBCLANG_LOGGING = '1';
214214
// env.MALLOC_CHECK_ = '2';
215215

216216
let serverOptions: ServerOptions = {
217217
command: clientConfig.launchCommand,
218218
args: args,
219-
options: {
220-
env: env
221-
}
219+
options: {env: env}
222220
};
223221
console.log(
224222
`Starting ${serverOptions.command} in ${serverOptions.options.cwd}`);
@@ -281,14 +279,12 @@ export function activate(context: ExtensionContext) {
281279
uri: document.uri.toString(),
282280
},
283281
})
284-
.then(
285-
(a: ls.CodeLens[]):
286-
CodeLens[] => {
287-
let result: CodeLens[] =
288-
languageClient.protocol2CodeConverter.asCodeLenses(a);
289-
displayCodeLens(document, result);
290-
return [];
291-
});
282+
.then((a: ls.CodeLens[]): CodeLens[] => {
283+
let result: CodeLens[] =
284+
languageClient.protocol2CodeConverter.asCodeLenses(a);
285+
displayCodeLens(document, result);
286+
return [];
287+
});
292288
};
293289

294290
// Options to control the language client
@@ -525,51 +521,54 @@ export function activate(context: ExtensionContext) {
525521

526522
// Inheritance hierarchy.
527523
(() => {
528-
const inheritanceHierarchyProvider = new InheritanceHierarchyProvider(languageClient);
524+
const inheritanceHierarchyProvider =
525+
new InheritanceHierarchyProvider(languageClient);
529526
window.registerTreeDataProvider(
530527
'cquery.inheritanceHierarchy', inheritanceHierarchyProvider);
531-
commands.registerTextEditorCommand('cquery.inheritanceHierarchy', (editor) => {
532-
setContext('extension.cquery.inheritanceHierarchyVisible', true);
533-
534-
let position = editor.selection.active;
535-
let uri = editor.document.uri;
536-
languageClient
537-
.sendRequest('$cquery/inheritanceHierarchy', {
538-
textDocument: {
539-
uri: uri.toString(),
540-
},
541-
position: position,
542-
derived: true,
543-
detailedName: false,
544-
levels: 1
545-
})
546-
.then((entry: InheritanceHierarchyNode) => {
547-
InheritanceHierarchyNode.setWantsDerived(entry, true);
548-
549-
languageClient.sendRequest('$cquery/inheritanceHierarchy', {
550-
id: entry.id,
551-
kind: entry.kind,
552-
derived: false,
553-
detailedName: false,
554-
levels: 1
555-
})
556-
.then((parentEntry: InheritanceHierarchyNode) => {
557-
if (parentEntry.numChildren > 0) {
558-
let parentWrapper = new InheritanceHierarchyNode();
559-
parentWrapper.children = parentEntry.children;
560-
parentWrapper.numChildren = parentEntry.children.length;
561-
parentWrapper.name = '[[Base]]';
562-
InheritanceHierarchyNode.setWantsDerived(parentWrapper, false);
563-
entry.children.splice(0, 0, parentWrapper);
564-
entry.numChildren += 1;
565-
}
566-
567-
inheritanceHierarchyProvider.root = entry;
568-
inheritanceHierarchyProvider.onDidChangeEmitter.fire();
569-
});
570-
571-
})
572-
});
528+
commands.registerTextEditorCommand(
529+
'cquery.inheritanceHierarchy', (editor) => {
530+
setContext('extension.cquery.inheritanceHierarchyVisible', true);
531+
532+
let position = editor.selection.active;
533+
let uri = editor.document.uri;
534+
languageClient
535+
.sendRequest('$cquery/inheritanceHierarchy', {
536+
textDocument: {
537+
uri: uri.toString(),
538+
},
539+
position: position,
540+
derived: true,
541+
detailedName: false,
542+
levels: 1
543+
})
544+
.then((entry: InheritanceHierarchyNode) => {
545+
InheritanceHierarchyNode.setWantsDerived(entry, true);
546+
547+
languageClient
548+
.sendRequest('$cquery/inheritanceHierarchy', {
549+
id: entry.id,
550+
kind: entry.kind,
551+
derived: false,
552+
detailedName: false,
553+
levels: 1
554+
})
555+
.then((parentEntry: InheritanceHierarchyNode) => {
556+
if (parentEntry.numChildren > 0) {
557+
let parentWrapper = new InheritanceHierarchyNode();
558+
parentWrapper.children = parentEntry.children;
559+
parentWrapper.numChildren = parentEntry.children.length;
560+
parentWrapper.name = '[[Base]]';
561+
InheritanceHierarchyNode.setWantsDerived(
562+
parentWrapper, false);
563+
entry.children.splice(0, 0, parentWrapper);
564+
entry.numChildren += 1;
565+
}
566+
567+
inheritanceHierarchyProvider.root = entry;
568+
inheritanceHierarchyProvider.onDidChangeEmitter.fire();
569+
});
570+
})
571+
});
573572
commands.registerCommand('cquery.closeinheritanceHierarchy', () => {
574573
setContext('extension.cquery.inheritanceHierarchyVisible', false);
575574
inheritanceHierarchyProvider.root = undefined;
@@ -589,7 +588,8 @@ export function activate(context: ExtensionContext) {
589588
context.asAbsolutePath(path.join('resources', 'base-light.svg'));
590589
const callHierarchyProvider = new CallHierarchyProvider(
591590
languageClient, derivedDark, derivedLight, baseDark, baseLight);
592-
window.registerTreeDataProvider('cquery.callHierarchy', callHierarchyProvider);
591+
window.registerTreeDataProvider(
592+
'cquery.callHierarchy', callHierarchyProvider);
593593
commands.registerTextEditorCommand('cquery.callHierarchy', (editor) => {
594594
setContext('extension.cquery.callHierarchyVisible', true);
595595
let position = editor.selection.active;
@@ -620,7 +620,8 @@ export function activate(context: ExtensionContext) {
620620
// Common between tree views.
621621
(() => {
622622
commands.registerCommand(
623-
'cquery.gotoForTreeView', (node: InheritanceHierarchyNode|CallHierarchyNode) => {
623+
'cquery.gotoForTreeView',
624+
(node: InheritanceHierarchyNode|CallHierarchyNode) => {
624625
if (!node.location)
625626
return;
626627

@@ -634,7 +635,8 @@ export function activate(context: ExtensionContext) {
634635
let lastGotoClickTime: number
635636
commands.registerCommand(
636637
'cquery.hackGotoForTreeView',
637-
(node: InheritanceHierarchyNode|CallHierarchyNode, hasChildren: boolean) => {
638+
(node: InheritanceHierarchyNode|CallHierarchyNode,
639+
hasChildren: boolean) => {
638640
if (!node.location)
639641
return;
640642

@@ -719,8 +721,7 @@ export function activate(context: ExtensionContext) {
719721
return decorations[symbol.stableId % decorations.length];
720722
};
721723

722-
if (symbol.kind == SymbolKind.Class ||
723-
symbol.kind == SymbolKind.Struct) {
724+
if (symbol.kind == SymbolKind.Class || symbol.kind == SymbolKind.Struct) {
724725
return get('types');
725726
} else if (symbol.kind == SymbolKind.Enum) {
726727
return get('enums');
@@ -730,8 +731,9 @@ export function activate(context: ExtensionContext) {
730731
return get('templateParameters');
731732
} else if (symbol.kind == SymbolKind.Function) {
732733
return get('freeStandingFunctions');
733-
} else if (symbol.kind == SymbolKind.Method ||
734-
symbol.kind == SymbolKind.Constructor) {
734+
} else if (
735+
symbol.kind == SymbolKind.Method ||
736+
symbol.kind == SymbolKind.Constructor) {
735737
return get('memberFunctions')
736738
} else if (symbol.kind == SymbolKind.StaticMethod) {
737739
return get('staticMemberFunctions')

0 commit comments

Comments
 (0)