diff --git a/.gitignore b/.gitignore index 9220beb..dd90b50 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ circup* /boards new.diff .DS_Store +/tmp +.history +build +*.tar.gz \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore index 4a6ac7c..7f5f720 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -24,3 +24,4 @@ native Makefile package.sh new.diff +/scripts \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ee711b..009e739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to the "vscode-circuitpython" extension will be documented in this file. +## [0.1.10] +- Disable pylint by default +- Opt in to pylance by default +- Added link to [GitHub Discussions](https://github.com/joedevivo/vscode-circuitpython/discussions) for Q&A. + + ## [0.1.9] - Library management fix [#37](https://github.com/joedevivo/vscode-circuitpython/pull/37) - thanks @makermelissa! diff --git a/README.md b/README.md index c4afcb4..e3980b9 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,29 @@ Inspired by [Scott Hanselman's blog post](https://www.hanselman.com/blog/UsingVisualStudioCodeToProgramCircuitPythonWithAnAdaFruitNeoTrellisM4.aspx) and the [VSCode Arduino extension](https://github.com/Microsoft/vscode-arduino). +## Getting Started + +The extension will currently activate when any of the following occur: + +* workspace contains + * `/code.py` + * `/code.txt` + * `/main.py` + * `/main.txt` + * `/boot_out.txt` +* command run + * `circuitpython.openSerialMonitor` + * `circuitpython.selectSerialPort` + * `circuitpython.closeSerialMonitor` + +Upon activation, the extension will check for the latest +[Adafruit_CircuitPython_Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle) +and download it if needed. It'll then load that library metadata into the +workspace's state. You can also trigger this manually with `CircuitPython: Check +for latest bundle`. + +After that you should be ready to use the following features. + ## Features ### Library Management @@ -67,16 +90,6 @@ library and all py source files in the adafruit bundle to your completion path. ![Demo](images/circuitpy-demo.gif) -## TODO / Future Work - -* Refactor as I learn more about VSCode Extensions & Typescript - [#11](joedevivo/vscode-circuitpython#11) -* Automate the platform specific binding stuff [#8](joedevivo/vscode-circuitpython#8) -* Share library state in globalState, only managing it once per all - vscode workspaces [#6](joedevivo/vscode-circuitpython#6) -* Quick open Adafruit Bundle examples [#10](joedevivo/vscode-circuitpython#10) -* Quick open readthedocs.io for a library [#9](joedevivo/vscode-circuitpython#9) - ## Requirements ## Extension Settings diff --git a/package.json b/package.json index b5cfd91..de4e154 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,10 @@ "name": "vscode-circuitpython", "displayName": "CircuitPython", "description": "CircuitPython for Visual Studio Code", - "version": "0.1.9", + "version": "0.1.10", "publisher": "joedevivo", "license": "MIT", + "qna": "https://github.com/joedevivo/vscode-circuitpython/discussions", "repository": { "type": "git", "url": "https://github.com/joedevivo/vscode-circuitpython.git" @@ -13,7 +14,7 @@ "url": "https://github.com/joedevivo/vscode-circuitpython/issues" }, "engines": { - "vscode": "^1.53.0" + "vscode": "^1.55.0" }, "icon": "images/BlinkaOnDark.png", "categories": [ @@ -23,10 +24,14 @@ "iot", "adafruit", "circuitpython", - "blinka" + "blinka", + "python" ], "activationEvents": [ "workspaceContains:/code.py", + "workspaceContains:/code.txt", + "workspaceContains:/main.py", + "workspaceContains:/main.txt", "workspaceContains:/boot_out.txt", "onCommand:circuitpython.openSerialMonitor", "onCommand:circuitpython.selectSerialPort", @@ -126,7 +131,8 @@ "test": "node ./out/test/runTest.js" }, "extensionDependencies": [ - "ms-python.python" + "ms-python.python", + "ms-python.vscode-pylance" ], "devDependencies": { "@types/glob": "^7.1.3", diff --git a/src/extension.ts b/src/extension.ts index 7c2a51d..b44ba4b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2,9 +2,14 @@ import * as vscode from 'vscode'; import { Container } from './container'; export async function activate(context: vscode.ExtensionContext) { - // Disable jedi - vscode.workspace.getConfiguration().update("python.jediEnabled", false); + vscode.workspace.getConfiguration().update("python.languageServer", "Pylance"); + vscode.workspace.getConfiguration().update("python.linting.pylintEnabled", false); + vscode.workspace.getConfiguration().update("python.analysis.diagnosticSeverityOverrides", + { + "reportMissingModuleSource": "none" + } + ); let container: Container = await Container.newInstance(context); } diff --git a/src/project.ts b/src/project.ts index 725ee0a..145e10a 100644 --- a/src/project.ts +++ b/src/project.ts @@ -20,7 +20,7 @@ export class Project implements vscode.Disposable { public constructor(context: vscode.ExtensionContext) { this._context = context; - let autoConf: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("python.autoComplete"); + let autoConf: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("python.analysis"); let paths: string[] = autoConf.get("extraPaths"); // Load paths from last session @@ -91,7 +91,7 @@ export class Project implements vscode.Disposable { this._autoCompleteBundle ].concat(this._autoCompleteExtra); vscode.workspace.getConfiguration().update( - "python.autoComplete.extraPaths", + "python.analysis.extraPaths", paths ); }