Skip to content

Commit

Permalink
fix: space strip and tweak settings txt
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Sep 15, 2020
1 parent 9f7db02 commit 6289e32
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

All notable changes to the "nextbasic" extension will be documented in this file.

## [1.5.3] - 2020-09-15

- Fix issues in format document when spaces were being incorrectly striped
- Add expose the current txt2bas version (useful for debugging)

## [1.5.2] - 2020-09-10

- Add more detailed error reporting if cspect fails to launch
Expand Down
2 changes: 2 additions & 0 deletions extension.js
Expand Up @@ -15,6 +15,7 @@ const runInCspect = require('./lib/auto-run.task');
const validationDiagnostic = require('./lib/validation.diagnostic');
const shift = require('./lib/shift.command');
const renumber = require('./lib/renumber.command');
const txt2basVersion = require('./lib/txt2bas-version.command');

/**
* @param {vscode.ExtensionContext} context
Expand All @@ -37,6 +38,7 @@ function activate(context) {
context.subscriptions.push(hoverHelp());
context.subscriptions.push(runInCspect(context.extensionPath));
context.subscriptions.push(validationDiagnostic(context));
context.subscriptions.push(txt2basVersion());
}

function deactivate() {}
Expand Down
4 changes: 1 addition & 3 deletions lib/format-on-type.provider.js
Expand Up @@ -10,9 +10,7 @@ const format = (module.exports.format = (document, position) => {
const line = document.lineAt(position.line - 1).text;
if (line.trim() === '') return;

const autoline = isAutoLine(document);

const formatted = formatText(line, autoline);
const formatted = formatText(line, true);
const editor = vscode.window.activeTextEditor;
return editor.edit((editBuilder) => {
editBuilder.replace(
Expand Down
16 changes: 16 additions & 0 deletions lib/txt2bas-version.command.js
@@ -0,0 +1,16 @@
const vscode = require('vscode');
const { version } = require('txt2bas');

console.log(version);

module.exports = main;

function main() {
return vscode.commands.registerTextEditorCommand(
'nextbasic.txt2basVersion',
() =>
vscode.window.showInformationMessage(
'Current txt2bas version: v' + version
)
);
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions package.json
Expand Up @@ -3,7 +3,7 @@
"displayName": "NextBASIC",
"description": "NextBASIC",
"publisher": "remysharp",
"version": "1.5.2",
"version": "1.5.3",
"prettier": {
"singleQuote": true
},
Expand Down Expand Up @@ -45,7 +45,7 @@
"nextbasic.hdfmonkeyPath": {
"type": "string",
"default": "hdfmonkey",
"description": "Points the hdfmonkey binary, defaults to searching your $PATH"
"description": "Points the full path to the hdfmonkey executable, defaults to searching your $PATH"
},
"nextbasic.commentWith": {
"type": "string",
Expand Down Expand Up @@ -115,6 +115,12 @@
"command": "nextbasic.commentLine",
"key": "ctrl+/",
"when": "!isMac && editorLangId == nextbasic"
},
{
"key": "shift+ctrl+r",
"mac": "shift+cmd+r",
"command": "nextbasic.run",
"when": "editorTextFocus && editorLangId == 'nextbasic'"
}
],
"commands": [
Expand Down Expand Up @@ -153,6 +159,10 @@
{
"title": "NextBASIC: Comment",
"command": "nextbasic.commentLine"
},
{
"title": "NextBASIC: txt2bas version",
"command": "nextbasic.txt2basVersion"
}
]
},
Expand All @@ -176,7 +186,7 @@
},
"dependencies": {
"lodash.debounce": "^4.0.8",
"txt2bas": "^1.14.1"
"txt2bas": "^1.14.3"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 6289e32

Please sign in to comment.