Skip to content

Commit 59699f2

Browse files
dklilleyGitHub Enterprise
authored andcommitted
Merge pull request mathworks#61 from development/dlilley/release/1.3.1
Dlilley/release/1.3.1
2 parents 6178cbe + 18b79db commit 59699f2

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ MATLAB language server supports these editors by installing the corresponding ex
2525
## Release Notes
2626

2727
### Unreleased
28+
29+
### 1.3.1
30+
Release date: 2025-01-23
31+
32+
Added:
33+
* The language server keeps the MATLAB path in sync with the client workspace, improving code navigation, completions, and execution
34+
2835
Fixed:
36+
* Resolves errors with document formatting when using with MATLAB R2025a
2937
* Resolves errors with execution and debugging when using with MATLAB R2022a
3038

3139
### 1.3.0

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matlab-language-server",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Language Server for MATLAB code",
55
"main": "./src/index.ts",
66
"bin": "./out/index.js",

src/lifecycle/MatlabCommunicationManager.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/mvm/impl/MVM.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/providers/formatting/FormatSupportProvider.test.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1+
// // Copyright 2024 The MathWorks, Inc.
12
// import assert from 'assert'
23
// import sinon from 'sinon'
3-
4+
//
45
// import FormatSupportProvider from '../../../src/providers/formatting/FormatSupportProvider'
56
// import MatlabLifecycleManager from '../../../src/lifecycle/MatlabLifecycleManager'
67
// import ClientConnection from '../../../src/ClientConnection'
7-
8+
//
89
// import { TextDocument } from 'vscode-languageserver-textdocument'
910
// import { _Connection, DocumentFormattingParams, Position, Range, TextDocuments, TextEdit } from 'vscode-languageserver'
1011
// import getMockConnection from '../../mocks/Connection.mock'
11-
12+
//
1213
// describe('FormatSupportProvider', () => {
1314
// let formatSupportProvider: FormatSupportProvider
1415
// let matlabLifecycleManager: MatlabLifecycleManager
1516
// let documentManager: TextDocuments<TextDocument>
1617
// let mockMatlabConnection: any
1718
// let mockTextDocument: TextDocument
18-
19+
//
1920
// before(() => {
2021
// ClientConnection._setConnection(getMockConnection())
2122
// })
22-
23+
//
2324
// after(() => {
2425
// ClientConnection._clearConnection()
2526
// })
26-
27+
//
2728
// describe('#handleDocumentFormatRequest', () => {
2829
// // Because the actual formatting logic occurs in MATLAB, the actual value of these
2930
// // params are not tested in this file. So, define static params for each test.
3031
// const mockParams = {
3132
// textDocument: { uri: 'file:///test.m' },
3233
// options: { insertSpaces: true, tabSize: 4 }
3334
// } as DocumentFormattingParams
34-
35+
//
3536
// beforeEach(() => {
3637
// matlabLifecycleManager = new MatlabLifecycleManager()
3738
// formatSupportProvider = new FormatSupportProvider(matlabLifecycleManager)
@@ -43,49 +44,49 @@
4344
// publish: sinon.stub()
4445
// }
4546
// mockTextDocument = TextDocument.create('file:///test.m', 'matlab', 1, 'function y = test(x)\ny = x + 1;\nend')
46-
47+
//
4748
// sinon.stub(matlabLifecycleManager, 'getMatlabConnection').returns(mockMatlabConnection)
4849
// sinon.stub(documentManager, 'get').returns(mockTextDocument)
4950
// })
50-
51+
//
5152
// afterEach(() => {
5253
// sinon.restore()
5354
// })
54-
55+
//
5556
// it('should return null if no document to format', async () => {
5657
// // Return undefined text document
5758
// (documentManager.get as sinon.SinonStub).returns(undefined)
58-
59+
//
5960
// const res = await formatSupportProvider.handleDocumentFormatRequest(mockParams, documentManager)
60-
61+
//
6162
// assert.equal(res, null, 'Result should be null when there is no document')
6263
// })
63-
64+
//
6465
// it('should return empty array if no MATLAB connection', async () => {
6566
// // Return null MATLAB connection
6667
// (matlabLifecycleManager.getMatlabConnection as sinon.SinonStub).resolves(null)
67-
68+
//
6869
// const res = await formatSupportProvider.handleDocumentFormatRequest(mockParams, documentManager)
69-
70+
//
7071
// assert.deepEqual(res, [], 'Result should be [] when there is no connection')
7172
// })
72-
73+
//
7374
// it('should handle successful formatting', async () => {
7475
// const formattedCode = 'function y = test(x)\n y = x + 1;\nend'
7576
// const expectedEdit = TextEdit.replace(
7677
// Range.create(Position.create(0, 0), Position.create(2, 3)),
7778
// formattedCode
7879
// )
79-
80+
//
8081
// mockMatlabConnection.subscribe.callsFake((channel: string, callback: any) => {
8182
// setTimeout(() => {
8283
// callback({ data: formattedCode })
8384
// }, 0)
8485
// return 'subscription-id'
8586
// })
86-
87+
//
8788
// const result = await formatSupportProvider.handleDocumentFormatRequest(mockParams, documentManager)
88-
89+
//
8990
// assert.deepStrictEqual(result, [expectedEdit])
9091
// sinon.assert.calledOnce(mockMatlabConnection.publish)
9192
// sinon.assert.calledWith(mockMatlabConnection.publish, formatSupportProvider.REQUEST_CHANNEL, {

0 commit comments

Comments
 (0)