Skip to content

MATLAB language server - v1.1.7 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 6, 2023
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

MATLAB® language server implements the Microsoft® [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) for the MATLAB language.

MATLAB language server requires MATLAB version R2021a or later.

## Features Implemented
MATLAB language server implements several Language Server Protocol features and their related services:
* Code diagnostics — [publishDiagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics)
Expand All @@ -23,6 +25,14 @@ MATLAB language server supports these editors by installing the corresponding ex

### Unreleased

### 1.1.7
Release date: 2023-12-06

Fixed:
* Fixed code navigation when using with MATLAB R2024a
* Handle symbolic link to MATLAB when linting with mlint (Thanks @MoetaYuko!)
* Handle maca64 architecture when linting with mlint (Thanks @tiagovla!)

### 1.1.6
Release date: 2023-10-11

Expand Down
21 changes: 19 additions & 2 deletions matlab/+matlabls/+handlers/NavigationSupportHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function handleResolvePathRequest (this, msg)
response.data = cell(1, numel(names));
for n = 1:numel(names)
name = names{n};
path = matlabls.internal.resolvePath(name, contextFile);
path = resolvePath(name, contextFile);
response.data{n} = struct(name = name, path = path);
end

Expand All @@ -38,7 +38,7 @@ function handleResolvePathRequest (this, msg)
if ~isempty(missingIndices)
returnDir = cdToPackageRoot(contextFile);
for n = missingIndices
path = matlabls.internal.resolvePath(names{n}, contextFile);
path = resolvePath(names{n}, contextFile);
if ~isempty(path)
response.data{n}.path = path;
end
Expand All @@ -51,6 +51,23 @@ function handleResolvePathRequest (this, msg)
end
end

function path = resolvePath (name, contextFile)
if isMATLABReleaseOlderThan('R2023b')
% For usage in R2023b and earlier
[isFound, path] = matlabls.internal.resolvePath(name, contextFile);
elseif isMATLABReleaseOlderThan('R2024a')
% For usage in R2023b only
[isFound, path] = matlab.internal.language.introspective.resolveFile(name, []);
else
% For usage in R2024a and later
[isFound, path] = matlab.lang.internal.introspective.resolveFile(name, []);
end

if ~isFound
path = '';
end
end

function returnDir = cdToPackageRoot (filePath)
% Given a file path, CDs to the directory at the root-level of the
% file's package structure. If the file is not within a package,
Expand Down
Binary file modified matlab/+matlabls/+internal/resolvePath.p
Binary file not shown.
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.6",
"version": "1.1.7",
"description": "Language Server for MATLAB code",
"main": "./src/index.ts",
"scripts": {
Expand Down