Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions matlab/+matlabls/+handlers/NavigationSupportHandler.m
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions matlab/initmatlabls.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/lifecycle/MatlabLifecycleManager.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion src/logging/TelemetryUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 The MathWorks, Inc.
// Copyright 2023-2024 The MathWorks, Inc.

import NotificationService, { Notification } from '../notifications/NotificationService'

Expand All @@ -11,6 +11,7 @@ export enum Actions {
OpenFile = 'openFile',
StartMatlab = 'startMATLAB',
ShutdownMatlab = 'shutdownMATLAB',
MatlabSessionKey = 'getMATLABSession',
FormatDocument = 'formatDocument',
GoToReference = 'goToReference',
GoToDefinition = 'goToDefinition',
Expand Down
4 changes: 2 additions & 2 deletions src/providers/linting/LintingSupportProvider.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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)
Expand Down