Skip to content

Commit 1c90b73

Browse files
committed
Update JSDocs and Javadocs
1 parent a270d53 commit 1c90b73

2 files changed

Lines changed: 38 additions & 33 deletions

File tree

client/src/extension.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
3030
export 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
*/
7373
function 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
*/
8585
function 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
*/
9898
function 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
*/
117117
function 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
*/
171171
function 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+
*/
186190
async 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
*/
196200
function 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
*/
214218
async 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
*/
253257
async 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
*/
315319
async 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
*/
350354
function 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
*/
365369
function handleActiveFileChange(editor: vscode.TextEditor) {
366370
currentFile = editor.document.uri.fsPath;

server/src/main/java/fsm/StateMachineParser.java

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class StateMachineParser {
2424

2525
/**
2626
* Parses a class or interface for the given uri and extracts the state machine information
27-
* @param uri
27+
* @param uri the document URI
2828
* @return StateMachine or null if none found
2929
*/
3030
public static StateMachine parse(String uri) {
@@ -75,7 +75,7 @@ public static StateMachine parse(String uri) {
7575

7676
/**
7777
* Finds the first class or interface in the model (we assume only one per file)
78-
* @param model
78+
* @param model the CtModel
7979
* @return CtType or null if none found
8080
*/
8181
private static CtType<?> getType(CtModel model) {
@@ -90,7 +90,7 @@ private static CtType<?> getType(CtModel model) {
9090
/**
9191
* Gets the simple name from a class or interface
9292
* Uses name from ExternalRefinementsFor if present, otherwise uses class or interface name
93-
* @param ctType
93+
* @param ctType the CtType (class or interface)
9494
* @return class name
9595
*/
9696
private static String getClassName(CtType<?> ctType) {
@@ -105,7 +105,7 @@ private static String getClassName(CtType<?> ctType) {
105105

106106
/**
107107
* Gets the possible states from a class or interface
108-
* @param ctType
108+
* @param ctType the CtType (class or interface)
109109
* @return list of states
110110
*/
111111
private static List<String> getStates(CtType<?> ctType) {
@@ -121,7 +121,8 @@ private static List<String> getStates(CtType<?> ctType) {
121121
/**
122122
* Gets the initial state from a class
123123
* If not explicitely defined, uses the first state in the state set
124-
* @param ctClass
124+
* @param ctClass the CtClass
125+
* @param states the list of states
125126
* @return initial state
126127
*/
127128
private static String getInitialStateFromClass(CtClass<?> ctClass, List<String> states) {
@@ -142,8 +143,8 @@ private static String getInitialStateFromClass(CtClass<?> ctClass, List<String>
142143
/**
143144
* Gets the initial state from an interface
144145
* If not explicitely defined, uses the first state in the state set
145-
* @param ctInterface
146-
* @param className
146+
* @param ctInterface the CtInterface
147+
* @param className the class name
147148
* @return initial state
148149
*/
149150
private static String getInitialStateFromInterface(CtInterface<?> ctInterface, String className, List<String> states) {
@@ -165,8 +166,8 @@ private static String getInitialStateFromInterface(CtInterface<?> ctInterface, S
165166

166167
/**
167168
* Gets transitions from a class
168-
* @param ctClass
169-
* @param states
169+
* @param ctClass the CtClass
170+
* @param states the list of states
170171
* @return list of StateMachineTransition
171172
*/
172173
private static List<StateMachineTransition> getTransitionsFromClass(CtClass<?> ctClass, List<String> states) {
@@ -185,9 +186,9 @@ private static List<StateMachineTransition> getTransitionsFromClass(CtClass<?> c
185186

186187
/**
187188
* Gets transitions from an interface
188-
* @param ctInterface
189-
* @param className
190-
* @param states
189+
* @param ctInterface the CtInterface
190+
* @param className the class name
191+
* @param states the list of states
191192
* @return list of StateMachineTransition
192193
*/
193194
private static List<StateMachineTransition> getTransitionsFromInterface(CtInterface<?> ctInterface, String className, List<String> states) {
@@ -207,9 +208,9 @@ private static List<StateMachineTransition> getTransitionsFromInterface(CtInterf
207208

208209
/**
209210
* Gets transitions from the given annotation
210-
* @param ann
211-
* @param method
212-
* @param states
211+
* @param ann the CtAnnotation
212+
* @param method the method name
213+
* @param states the list of states
213214
* @return list of StateMachineTransition
214215
*/
215216
private static List<StateMachineTransition> getTransitions(CtAnnotation<?> ann, String method, List<String> states) {
@@ -242,8 +243,8 @@ private static List<StateMachineTransition> getTransitions(CtAnnotation<?> ann,
242243

243244
/**
244245
* Parses a state expression and returns the list of states
245-
* @param expr
246-
* @param states
246+
* @param expr the expression
247+
* @param states the list of possible states
247248
* @return list of states
248249
*/
249250
private static List<String> parseStateExpression(String expr, List<String> states) {
@@ -254,8 +255,8 @@ private static List<String> parseStateExpression(String expr, List<String> state
254255

255256
/**
256257
* Gets state names from an expression AST recursively
257-
* @param expr
258-
* @param states
258+
* @param expr the expression
259+
* @param states the list of possible states
259260
* @return list of states
260261
*/
261262
private static List<String> getStateExpressions(Expression expr, List<String> states) {

0 commit comments

Comments
 (0)