Skip to content

Commit

Permalink
Merge pull request #63 from Autodesk/update_4.1.5_EslintRules
Browse files Browse the repository at this point in the history
Update 4.1.5 Added support for using ESLint rules
  • Loading branch information
george-roberts authored Jan 11, 2024
2 parents 3172640 + 3cecc04 commit 666468b
Show file tree
Hide file tree
Showing 20 changed files with 4,114 additions and 8 deletions.
7 changes: 7 additions & 0 deletions vs-code-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Change Log
## 4.1.5
Added:
- Added option to use Autodesk's ESLint rules for editing postprocessors
## 4.1.4
Updated:
- Added new CNC files
- Added a turnmill machine
## 4.1.3
Fixed:
- Fixed broken link to help file
Expand Down
2 changes: 1 addition & 1 deletion vs-code-extension/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 by Autodesk, Inc.
Copyright (c) 2023 by Autodesk, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
6 changes: 3 additions & 3 deletions vs-code-extension/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Autodesk Fusion 360 Post Processor Utility for Visual Studio Code
# Autodesk Fusion Post Processor Utility for Visual Studio Code

Welcome to the Autodesk Fusion 360 Post Utility extension for Visual Studio Code (https://code.visualstudio.com/). This extension adds several functions that will aid you when working on post development specifically for Fusion 360, Inventor CAM and HSMWorks. Please note that this utility is not compatible with FeatureCAM, PartMarker and PowerMILL.
Welcome to the Autodesk Fusion Post Utility extension for Visual Studio Code (https://code.visualstudio.com/). This extension adds several functions that will aid you when working on post development specifically for Fusion, Inventor CAM and HSMWorks. Please note that this utility is not compatible with FeatureCAM, PartMarker and PowerMILL.

To learn more about the CAM solutions see:
https://www.autodesk.com/solutions/manufacturing/cam
Expand Down Expand Up @@ -37,7 +37,7 @@ The documentation of the postprocessor API can be found here:
https://cam.autodesk.com/posts/reference/index.html

# About
Autodesk Fusion 360 Post Processor Utility for Visual Studio Code © 2017 Autodesk, Inc. All rights reserved.
Autodesk Fusion Post Processor Utility for Visual Studio Code © 2017 Autodesk, Inc. All rights reserved.

All use of this Software is subject to the Autodesk terms of service accepted accepted upon access or use of this Service or made available on the Autodesk webpage. Autodesk terms of service for Autodesk’s various web services can be found [here](https://www.autodesk.com/company/legal-notices-trademarks/terms-of-service-autodesk360-web-services).

Expand Down
26 changes: 26 additions & 0 deletions vs-code-extension/out/src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function activate(context) {
// registering the appropriate event handlers
vscode.workspace.onDidSaveTextDocument(savedoc);
vscode.window.onDidChangeActiveTextEditor(checkForAutoComplete);
vscode.window.onDidChangeActiveTextEditor(setEmbeddedEslintRules);
vscode.window.onDidChangeTextEditorSelection(handleSelectionChange);
cleanupProperties();

Expand Down Expand Up @@ -1241,6 +1242,31 @@ function setIncludePath() {
});
}

/** Updates the settings.json file for ESlint usage depending on the user setting. */
function setEmbeddedEslintRules() {
let currentEslintConfiguration = vscode.workspace.getConfiguration("eslint");
let currentEditorConfiguration = vscode.workspace.getConfiguration("editor");
let newEslintConfiguration = Object.assign({}, currentEslintConfiguration.overrideConfigFile, {"overrideConfigFile": path.join(resLocation, ".eslintrc.json")});
let newEditorConfiguration
switch (vscode.workspace.getConfiguration("AutodeskPostUtility").get("useEmbeddedESLintRules")) {
case "Disabled":
newEditorConfiguration = Object.assign({}, currentEditorConfiguration.codeActionsOnSave, {"source.fixAll.eslint": false});
newEslintConfiguration = Object.assign({}, currentEslintConfiguration.overrideConfigFile, {});
break;
case "Show ESLint issues only":
newEditorConfiguration = Object.assign({}, currentEditorConfiguration.codeActionsOnSave, {"source.fixAll.eslint": false});
break;
case "Show and fix ESLint issues":
newEditorConfiguration = Object.assign({}, currentEditorConfiguration.codeActionsOnSave, {"source.fixAll.eslint": true});
break;
default:
errorMessage("Unknown command for setting useEmbeddedESLintRules.")
return;
}
vscode.workspace.getConfiguration("eslint").update("options", newEslintConfiguration, true);
vscode.workspace.getConfiguration("editor").update("codeActionsOnSave", newEditorConfiguration, true);
}

/**
* Locates the post executable on the users system
*
Expand Down
23 changes: 19 additions & 4 deletions vs-code-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hsm-post-processor",
"displayName": "Autodesk Fusion 360 Post Processor Utility",
"displayName": "Autodesk Fusion Post Processor Utility",
"description": "Post processor utility.",
"version": "4.1.3",
"version": "4.1.5",
"icon": "res/icons/logo.png",
"author": {
"name": "Autodesk",
Expand Down Expand Up @@ -355,12 +355,12 @@
"AutodeskPostUtility.postExecutablePath": {
"type": "string",
"default": "",
"description": "The location for the Fusion 360 post executable"
"description": "The location for the Fusion post executable"
},
"AutodeskPostUtility.secondaryPostExecutablePath": {
"type": "string",
"default": "",
"description": "The location for the secondary Fusion 360 post executable"
"description": "The location for the secondary Fusion post executable"
},
"AutodeskPostUtility.propertyJSON": {
"type": "object",
Expand Down Expand Up @@ -422,6 +422,21 @@
"default": "",
"description": "Sets an include path for use in post processing"
},
"AutodeskPostUtility.useEmbeddedESLintRules": {
"type": "string",
"enum": [
"Disabled",
"Show ESLint issues only",
"Show and fix ESLint issues"
],
"enumDescriptions": [
"Disable usage of embedded ESLint rules.",
"This option will show ESLint issues only.",
"This option will show and fix ESLint issues automatically when saving the file."
],
"default": "Disabled",
"markdownDescription": "Enable to use Autodesk's ESLint rules for editing postprocessor files (CPS/CPI files). Note that the [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) must be installed to be able to use this feature."
},
"AutodeskPostUtility.programName": {
"type": "string",
"default": "1001",
Expand Down
Loading

0 comments on commit 666468b

Please sign in to comment.