Skip to content

Commit

Permalink
Fix for yaml on some environments
Browse files Browse the repository at this point in the history
* If ROS extension is installed, yaml files cannot be indented.
* This is because packageLangData.configuration of ROS extension is
  undefined.
  • Loading branch information
garaemon committed Oct 29, 2023
1 parent 29a4614 commit 311aba7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-emacs-tab",
"displayName": "vscode-emacs-tab",
"description": "emacs like tab behavior",
"version": "0.1.0",
"version": "0.1.1",
"publisher": "garaemon",
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ function getLanguageConfiguration(id: string): ILanguageConfiguration | null {
ext.packageJSON.contributes.languages) {
const packageLangData = ext.packageJSON.contributes.languages.find(
(langData: any) => (langData.id === documentLanguageId));
if (packageLangData) {
// packageLangData.configuration can be undefined. For example, configuration of the ROS
// extension is undefined.
if (packageLangData && packageLangData.configuration) {
const langConfigFilepath =
path.join(ext.extensionPath, packageLangData.configuration);
const configFileContent = fs.readFileSync(langConfigFilepath).toString();
Expand Down

0 comments on commit 311aba7

Please sign in to comment.