Skip to content

Commit

Permalink
Added missing formatter provider support for xaml and yarn latest upg…
Browse files Browse the repository at this point in the history
…rades (#169)
  • Loading branch information
pmahend1 authored Nov 29, 2024
1 parent 739510f commit 75f2624
Show file tree
Hide file tree
Showing 9 changed files with 1,425 additions and 840 deletions.
17 changes: 6 additions & 11 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@
"tasks": [
{
"type": "npm",
"script": "esbuild-watch",
"problemMatcher": "$esbuild-watch",
"script": "watch",
"problemMatcher": "$ts-checker-webpack-watch",//amodio.tsl-problem-matcher
"isBackground": true,
"label": "npm: esbuild-watch",
"label": "npm: watch",
"presentation": {
"reveal": "never"
"reveal": "silent",
"showReuseMessage": true,
"panel": "dedicated"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "esbuild",
"group": "build",
"problemMatcher": "$esbuild",
"label": "npm: esbuild",
}
]
}
9 changes: 4 additions & 5 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ src/**
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
**/tslint.json
**/.eslintrc.json
**/*.map
**/*.ts
out/*.dll
**/*.deps.json
**/*.pdb
node_modules
webpack.config.js
*.yml
.github/**
node_modules/nan/**
node_modules/edge-cs/**
images/old_logo.png
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Stable

## 5.1.0: 29-Nov-2024

- Fixes [Formatting doesn't seem to work when using with .xaml files.](https://github.com/pmahend1/PrettyXML/issues/167)
- Yarn upgrades to latest.

## 5.0.3: 01-Sep-2024

- Yarn upgrades.
Expand Down
57 changes: 30 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"readme": "https://github.com/pmahend1/PrettyXML/blob/main/README.md",
"description": "XML formatter extension for Visual Studio Code. Formats XML documents just like Visual Studio.",
"version": "5.0.3",
"version": "5.1.0",
"publisher": "PrateekMahendrakar",
"repository": {
"url": "https://github.com/pmahend1/prettyxml.git"
Expand Down Expand Up @@ -34,13 +34,15 @@
"formatter"
],
"engines": {
"vscode": "^1.59.0"
"vscode": "^1.95.0"
},
"categories": [
"Formatters"
],
"activationEvents": [
"onLanguage:xml"
"onLanguage:xml",
"workspaceContains:**/*.xml",
"workspaceContains:**/*.xaml"
],
"main": "./out/extension.js",
"contributes": {
Expand Down Expand Up @@ -100,7 +102,7 @@
{
"command": "prettyxml.prettifyxml",
"group": "1_modification@100",
"when": "editorLangId == 'xml'"
"when": "editorLangId == 'xml' || editorLangId == 'xaml'"
}
]
},
Expand Down Expand Up @@ -199,34 +201,35 @@
]
},
"scripts": {
"vscode:prepublish": "yarn run esbuild-base --minify",
"compile": "tsc -p ./",
"lint": "eslint src --ext ts",
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=./out/extension.js --external:vscode --format=cjs --platform=node",
"esbuild": "yarn run esbuild-base --sourcemap",
"esbuild-watch": "yarn run esbuild-base --sourcemap --watch",
"test-compile": "tsc -p ./",
"pretest": "yarn run compile && yarn run lint",
"test": "node ./out/test/runTest.js"
"compile": "webpack --mode development",
"watch": "webpack --mode development --watch",
"vscode:prepublish": "npm run package",
"package": "webpack --mode production --devtool hidden-source-map",
"compile-tests": "tsc -p . --outDir out",
"pretest": "npm run compile-tests",
"test": "vscode-test"
},
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.13",
"@types/vscode": "^1.59.0",
"@typescript-eslint/eslint-plugin": "^4.29.0",
"@typescript-eslint/parser": "4.31.0",
"esbuild": "^0.15.10",
"eslint": "^7.6.0",
"glob": "^7.1.6",
"mocha": "^9.0.2",
"typescript": "^4.1.3",
"vscode-test": "^1.4.0"
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.1",
"@types/vscode": "^1.95.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "8.16.0",
"esbuild": "^0.24.0",
"eslint": "^9.15.0",
"glob": "^11.0.0",
"mocha": "^10.8.2",
"ts-loader": "^9.5.1",
"typescript": "^5.7.2",
"vscode-test": "^1.4.0",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@types/compare-versions": "^3.3.0",
"@types/compare-versions": "^3.3.3",
"child_process": "^1.0.2",
"compare-versions": "^3.6.0",
"compare-versions": "^6.1.1",
"fs": "^0.0.1-security",
"path": "^0.12.7"
}
Expand Down
3 changes: 1 addition & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
// imports
import * as vscode from "vscode";
import { DocumentHelper } from "./documentHelper";
import { Formatter } from "./formatter";
Expand Down Expand Up @@ -61,6 +59,7 @@ export function activate(context: vscode.ExtensionContext): void {
const xmlXsdDocSelector = [
...DocumentHelper.createLanguageDocumentFilters("xml"),
...DocumentHelper.createLanguageDocumentFilters("xsd"),
...DocumentHelper.createLanguageDocumentFilters("xaml"),
];
const xmlFormattingEditProvider = new PrettyXmlFormattingEditProvider(formatter);

Expand Down
15 changes: 0 additions & 15 deletions src/test/suite/extension.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions src/test/suite/index.ts

This file was deleted.

39 changes: 39 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//@ts-check

'use strict';

const path = require('path');

/**@type {import('webpack').Configuration}*/
const config = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/

entry: {
extension: './src/extension.ts'
},// the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'out'),
filename: '[name].js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: /\.ts$/,
exclude: /node_modules/,
use: [{
loader: 'ts-loader'
}]
}]
}
};
module.exports = config;
Loading

0 comments on commit 75f2624

Please sign in to comment.