@@ -25,7 +25,7 @@ let currentStateMachine: StateMachine | undefined;
2525
2626/**
2727 * Activates the LiquidJava extension
28- * @param context
28+ * @param context The extension context
2929 */
3030export async function activate ( context : vscode . ExtensionContext ) {
3131 initLogging ( context ) ;
@@ -68,7 +68,7 @@ export async function deactivate() {
6868
6969/**
7070 * Initializes logging for the extension with an output channel
71- * @param context
71+ * @param context The extension context
7272 */
7373function initLogging ( context : vscode . ExtensionContext ) {
7474 outputChannel = vscode . window . createOutputChannel ( "LiquidJava" ) ;
@@ -80,7 +80,7 @@ function initLogging(context: vscode.ExtensionContext) {
8080
8181/**
8282 * Initializes the status bar for the extension
83- * @param context
83+ * @param context The extension context
8484 */
8585function initStatusBar ( context : vscode . ExtensionContext ) {
8686 statusBarItem = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
@@ -93,7 +93,7 @@ function initStatusBar(context: vscode.ExtensionContext) {
9393
9494/**
9595 * Initializes the command palette for the extension
96- * @param context
96+ * @param context The extension context
9797 */
9898function initCommandPalette ( context : vscode . ExtensionContext ) {
9999 context . subscriptions . push (
@@ -112,7 +112,7 @@ function initCommandPalette(context: vscode.ExtensionContext) {
112112
113113/**
114114 * Initializes the webview panel for the extension
115- * @param context
115+ * @param context The extension context
116116 */
117117function initWebview ( context : vscode . ExtensionContext ) {
118118 webviewProvider = new LiquidJavaWebviewProvider ( context . extensionUri ) ;
@@ -166,7 +166,7 @@ function initHover() {
166166
167167/**
168168 * Initializes file system event listeners
169- * @param context
169+ * @param context The extension context
170170 */
171171function initFileEvents ( context : vscode . ExtensionContext ) {
172172 // listen for active text editor changes
@@ -183,6 +183,10 @@ function initFileEvents(context: vscode.ExtensionContext) {
183183 ) ;
184184}
185185
186+ /**
187+ * Requests the state machine for the given document from the language server
188+ * @param document The text document
189+ */
186190async function requestStateMachine ( document : vscode . TextDocument ) {
187191 const sm : StateMachine = await client ?. sendRequest ( "liquidjava/fsm" , { uri : document . uri . toString ( ) } ) ;
188192 webviewProvider ?. sendMessage ( { type : "fsm" , sm } ) ;
@@ -191,7 +195,7 @@ async function requestStateMachine(document: vscode.TextDocument) {
191195
192196/**
193197 * Updates the status bar with the current state
194- * @param state
198+ * @param state The current state ("loading", "stopped", "passed", "failed")
195199 */
196200function updateStatusBar ( state : "loading" | "stopped" | "passed" | "failed" ) {
197201 const icons = {
@@ -207,8 +211,8 @@ function updateStatusBar(state: "loading" | "stopped" | "passed" | "failed") {
207211
208212/**
209213 * Runs the LiquidJava language server
210- * @param context
211- * @param javaExecutablePath
214+ * @param context The extension context
215+ * @param javaExecutablePath The path to the Java executable
212216 * @returns A promise to the port number the server is running on
213217 */
214218async function runLanguageServer ( context : vscode . ExtensionContext , javaExecutablePath : string ) : Promise < number > {
@@ -247,8 +251,8 @@ async function runLanguageServer(context: vscode.ExtensionContext, javaExecutabl
247251
248252/**
249253 * Starts the client and connects it to the language server
250- * @param context
251- * @param port
254+ * @param context The extension context
255+ * @param port The port number the server is running on
252256 */
253257async function runClient ( context : vscode . ExtensionContext , port : number ) {
254258 const serverOptions : ServerOptions = ( ) => {
@@ -310,7 +314,7 @@ async function runClient(context: vscode.ExtensionContext, port: number) {
310314
311315/**
312316 * Stops the LiquidJava extension
313- * @param reason
317+ * @param reason The reason for stopping the extension
314318 */
315319async function stopExtension ( reason : string ) {
316320 if ( ! client && ! serverProcess && ! socket ) {
@@ -345,7 +349,7 @@ async function stopExtension(reason: string) {
345349
346350/**
347351 * Handles LiquidJava diagnostics received from the language server
348- * @param diagnostics
352+ * @param diagnostics The array of diagnostics received
349353 */
350354function handleLJDiagnostics ( diagnostics : LJDiagnostic [ ] ) {
351355 const containsError = diagnostics . some ( d => d . category === "error" ) ;
@@ -360,7 +364,7 @@ function handleLJDiagnostics(diagnostics: LJDiagnostic[]) {
360364
361365/**
362366 * Handles active file change events
363- * @param editor
367+ * @param editor The active text editor
364368 */
365369function handleActiveFileChange ( editor : vscode . TextEditor ) {
366370 currentFile = editor . document . uri . fsPath ;
0 commit comments