Skip to content

Commit

Permalink
Merge pull request #22 from MoetaYuko/main
Browse files Browse the repository at this point in the history
Resolve symlink of the `matlab` executable when finding install path
  • Loading branch information
dklilley authored Nov 6, 2023
2 parents 9fdc854 + ff8789b commit 319868d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/linting/LintingSupportProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ConfigurationManager from '../../lifecycle/ConfigurationManager'
import { MatlabConnection } from '../../lifecycle/MatlabCommunicationManager'
import MatlabLifecycleManager from '../../lifecycle/MatlabLifecycleManager'
import Logger from '../../logging/Logger'
import * as fs from 'fs/promises'
import * as path from 'path'
import which = require('which')
import { MatlabLSCommands } from '../lspCommands/ExecuteCommandProvider'
Expand Down Expand Up @@ -337,8 +338,9 @@ class LintingSupportProvider {
} else {
// Try to find the executable based on the location of the `matlab` executable
try {
const resolvedPath = await which('matlab')
let resolvedPath = await which('matlab')
if (resolvedPath !== '') {
resolvedPath = await fs.realpath(resolvedPath)
binPath = path.dirname(resolvedPath)
}
} catch {
Expand Down

0 comments on commit 319868d

Please sign in to comment.