diff --git a/README.md b/README.md index 17c3ef7..15fa7b5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ MATLAB language server supports these editors by installing the corresponding ex ### Unreleased +### 1.1.8 +Release date: 2024-01-16 + +Fixed: +* Fixed linting with mlint on Windows +* Fixed regression with code navigation when using with MATLAB R2024a + ### 1.1.7 Release date: 2023-12-06 diff --git a/matlab/+matlabls/+handlers/NavigationSupportHandler.m b/matlab/+matlabls/+handlers/NavigationSupportHandler.m index d65c5e7..fa37236 100644 --- a/matlab/+matlabls/+handlers/NavigationSupportHandler.m +++ b/matlab/+matlabls/+handlers/NavigationSupportHandler.m @@ -1,7 +1,7 @@ classdef (Hidden) NavigationSupportHandler < matlabls.handlers.FeatureHandler % NAVIGATIONHANDLER The feature handler to support navigation workflows. - % Copyright 2022 - 2023 The MathWorks, Inc. + % Copyright 2022 - 2024 The MathWorks, Inc. properties (Access = private) ResolvePathRequestChannel = '/matlabls/navigation/resolvePath/request' @@ -60,7 +60,8 @@ function handleResolvePathRequest (this, msg) [isFound, path] = matlab.internal.language.introspective.resolveFile(name, []); else % For usage in R2024a and later - [isFound, path] = matlab.lang.internal.introspective.resolveFile(name, []); + ec = matlab.lang.internal.introspective.ExecutionContext; + [isFound, path] = matlab.lang.internal.introspective.resolveFile(name, ec); end if ~isFound diff --git a/matlab/initmatlabls.m b/matlab/initmatlabls.m index 248f73f..ef43c85 100644 --- a/matlab/initmatlabls.m +++ b/matlab/initmatlabls.m @@ -2,7 +2,7 @@ function initmatlabls (outFile) % Initializes a MATLABĀ® session to talk to a MATLAB language server. % Writes connection info to the outFile specified by the client - % Copyright 2022 - 2023 The MathWorks, Inc. + % Copyright 2022 - 2024 The MathWorks, Inc. % Prevent clearing the workspace from cleaning up the MatlabLanguageServerHelper mlock @@ -26,7 +26,9 @@ function initmatlabls (outFile) function logConnectionData (outFile) c.matlabPid = feature("getpid"); - c.matlabRelease = ['R' version('-release')] + c.matlabRelease = ['R' version('-release')]; + c.sessionKey = dduxinternal.getSessionKey(); + connectionData = jsonencode(c); disp(strcat("Printing connection data to file: ", newline, " ", outFile)) diff --git a/package-lock.json b/package-lock.json index d0d5514..a661f24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "matlab-language-server", - "version": "1.1.7", + "version": "1.1.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "matlab-language-server", - "version": "1.1.7", + "version": "1.1.8", "license": "MIT", "dependencies": { "faye": "^1.4.0", diff --git a/package.json b/package.json index 2d1e5df..9f15071 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matlab-language-server", - "version": "1.1.7", + "version": "1.1.8", "description": "Language Server for MATLAB code", "main": "./src/index.ts", "bin": "./out/index.js", diff --git a/src/lifecycle/MatlabLifecycleManager.ts b/src/lifecycle/MatlabLifecycleManager.ts index 6e2df62..1608287 100644 --- a/src/lifecycle/MatlabLifecycleManager.ts +++ b/src/lifecycle/MatlabLifecycleManager.ts @@ -1,4 +1,4 @@ -// Copyright 2022 - 2023 The MathWorks, Inc. +// Copyright 2022 - 2024 The MathWorks, Inc. import { ChildProcess } from 'child_process' import { _Connection } from 'vscode-languageserver' @@ -326,12 +326,14 @@ class MatlabProcess { const info = JSON.parse(data.toString()) this._matlabPid = info.matlabPid - const matlabRelease = info.matlabRelease as string // e.g. R2023a + const matlabRelease: string = info.matlabRelease // e.g. R2023a + const sessionKey: string = info.sessionKey this._matlabConnection?.initialize().then(() => { fs.unwatchFile(outFile) LifecycleNotificationHelper.notifyConnectionStatusChange(ConnectionState.CONNECTED) reportTelemetryAction(Actions.StartMatlab, matlabRelease) + reportTelemetryAction(Actions.MatlabSessionKey, sessionKey) resolve() }).catch(() => { Logger.error('Failed to connect to MATLAB') diff --git a/src/logging/TelemetryUtils.ts b/src/logging/TelemetryUtils.ts index bad5889..3cd0647 100644 --- a/src/logging/TelemetryUtils.ts +++ b/src/logging/TelemetryUtils.ts @@ -1,4 +1,4 @@ -// Copyright 2023 The MathWorks, Inc. +// Copyright 2023-2024 The MathWorks, Inc. import NotificationService, { Notification } from '../notifications/NotificationService' @@ -11,6 +11,7 @@ export enum Actions { OpenFile = 'openFile', StartMatlab = 'startMATLAB', ShutdownMatlab = 'shutdownMATLAB', + MatlabSessionKey = 'getMATLABSession', FormatDocument = 'formatDocument', GoToReference = 'goToReference', GoToDefinition = 'goToDefinition', diff --git a/src/providers/linting/LintingSupportProvider.ts b/src/providers/linting/LintingSupportProvider.ts index f3967fd..9ca5d76 100644 --- a/src/providers/linting/LintingSupportProvider.ts +++ b/src/providers/linting/LintingSupportProvider.ts @@ -1,4 +1,4 @@ -// Copyright 2022 - 2023 The MathWorks, Inc. +// Copyright 2022 - 2024 The MathWorks, Inc. import { execFile, ExecFileException } from 'child_process' import { CodeAction, CodeActionKind, CodeActionParams, Command, Diagnostic, DiagnosticSeverity, Position, Range, TextDocumentEdit, TextEdit, VersionedTextDocumentIdentifier, WorkspaceEdit, _Connection } from 'vscode-languageserver' @@ -356,7 +356,7 @@ class LintingSupportProvider { const mlintExecutablePath = path.normalize(path.join( binPath, platformDir, - 'mlint' + process.platform === 'win32' ? 'mlint.exe' : 'mlint' )) try { await fs.access(mlintExecutablePath)