Skip to content

Commit

Permalink
Also scan workspaces for .u and .upk files and index them as an UCPac…
Browse files Browse the repository at this point in the history
…kage instance. Related to issue #139.
  • Loading branch information
EliotVU committed Jan 29, 2023
1 parent f9c2421 commit 7f8ea66
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 63 deletions.
10 changes: 6 additions & 4 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as path from 'path';
import { ExtensionContext, workspace } from 'vscode';
import {
LanguageClient, LanguageClientOptions, ServerOptions, TransportKind
} from 'vscode-languageclient/node';
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node';

let client: LanguageClient;

Expand Down Expand Up @@ -34,7 +32,11 @@ export function activate(context: ExtensionContext) {
documentSelector: [{ scheme: 'file', language: 'unrealscript' }],
synchronize: {
configurationSection: 'unrealscript',
fileEvents: workspace.createFileSystemWatcher('**/*.{uc,uci}')
fileEvents: [
workspace.createFileSystemWatcher('**/*.{uc,uci}'),
// Let's not watch for upk changes, just u files because those are expected to change often.
workspace.createFileSystemWatcher('**/*.{u}')
]
},
diagnosticCollectionName: 'UnrealScript',
outputChannelName: 'UnrealScript',
Expand Down
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,24 @@
"extends": "Object"
}
}
},
"unrealscript.indexPackageExtensions": {
"scope": "resource",
"type": "array",
"description": "A list of package (uc,upk) extensions to index.",
"default": [
"u",
"upk"
]
},
"unrealscript.indexDocumentExtensions": {
"scope": "resource",
"type": "array",
"description": "A list of document (uc) extensions to index.",
"default": [
"uc",
"uci"
]
}
}
},
Expand Down
17 changes: 17 additions & 0 deletions server/src/UPK/UnrealPackage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Implementation based on UnrealPackage.cs from https://github.com/EliotVU/Unreal-Library
*/
import { UCPackage } from '../UC/Symbols';

export type UnrealPackageSummary = {
version: number;
licenseeVersion: number;
}

export class UnrealPackage {
summary: UnrealPackageSummary;

constructor(public rootPackage: UCPackage) {

}
}
Loading

0 comments on commit 7f8ea66

Please sign in to comment.