Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #49 from inferrinizzard/repo/vscode
Browse files Browse the repository at this point in the history
Add VSCode Extension as subrepo, #44
  • Loading branch information
inferrinizzard authored Dec 7, 2021
2 parents f9d7cae + d33dadb commit 06cfbe6
Show file tree
Hide file tree
Showing 18 changed files with 3,045 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/lib
/dist
/coverage
/vscode
webpack.*.js
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/vscode-bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: VSCode Bug Report
about: Raise an issue with the VSCODE Extension
title: '[VSCODE] Issue Title Here'
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Usage**

- What SQL language(s) does this apply to? (Plese check the bottom right of your editor for the current VSCode language type)
- What VSCode version are you using?
- What are your currently configured VSCode settings for the `prettier-sql` extension, if relevant to the issue?

**Additional context**
Add any other context about the problem here.
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
The MIT License (MIT)

Copyright (c) 2016-2020 ZeroTurnaround LLC
Copyright (c) 2020-present George Leslie-Waksman and other contributors
Copyright (c) 2020-2021 George Leslie-Waksman and other contributors
Copyright (c) 2021-Present inferrinizzard and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */
},
"include": ["src", "test", "static"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "vscode"]
}
3 changes: 3 additions & 0 deletions vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
out/
.vscode-test/
17 changes: 17 additions & 0 deletions vscode/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
11 changes: 11 additions & 0 deletions vscode/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
20 changes: 20 additions & 0 deletions vscode/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
11 changes: 11 additions & 0 deletions vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.vscode/**
.vscode-test/**
out/test/**
src/**

.gitignore
.yarnrc
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
1 change: 1 addition & 0 deletions vscode/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
13 changes: 13 additions & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CHANGELOG

## [0.1.0] - 2021/11/23

- added wrapper for `prettier-sql`
- added VSCode settings for all configs present in v5 release
- added `prettier-sql` icon
- added formatProvider support on the following file languages:
- sql
- plsql
- mysql
- postgres
- hive
23 changes: 23 additions & 0 deletions vscode/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License (MIT)

Copyright (c) 2016-2020 ZeroTurnaround LLC
Copyright (c) 2020-2021 George Leslie-Waksman and other contributors
Copyright (c) 2021-Present inferrinizzard and other contributors

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 39 additions & 0 deletions vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Prettier SQL

Formats SQL files using the [`prettier-sql`](https://github.com/inferrinizzard/prettier-sql) library

## Issues

Please report issues here: https://github.com/inferrinizzard/prettier-sql/issues

Use the FORMATTING template if it is an issue related the formatting of the SQL, otherwise, please use the VSCODE template for issues with running the VSCode Extension

## Configuration

`Prettier-SQL.uppercaseKeywords`: Whether to print keywords in ALL CAPS or lowercase

`Prettier-SQL.keywordPosition`: Switched between standard keyword positioning vs maintaining a central space column

`Prettier-SQL.breakBeforeBooleanOperator`: Whether to break before or after AND and OR

`Prettier-SQL.aliasAS`: Where to use AS in column or table aliases

`Prettier-SQL.tabulateAlias`: Whether to right-align aliases to the longest line in the SELECT clause

`Prettier-SQL.commaPosition`: Where to place commas for SELECT and GROUP BY clauses

`Prettier-SQL.keywordNewline`: Rule for when to break keyword clauses onto a newline

`Prettier-SQL.itemCount`: Number of items before keyword breaks onto newline (only used when `Prettier-SQL.keywordNewline` is itemCount or hybrid)

`Prettier-SQL.openParenNewline`: Whether to place (, Open Paren, CASE on newline when creating a new block

`Prettier-SQL.closeParenNewline`: Whether to place ), Close Paren, END on newline when closing a block

`Prettier-SQL.lineWidth`: Number of characters allowed in each line before breaking

`Prettier-SQL.linesBetweenStatements`: How many newlines to place between each query / statement

`Prettier-SQL.denseOperators`: Whether to strip whitespace around operators such as + or >=

`Prettier-SQL.semicolonNewline`: Whether to place semicolon on its own line or on previous line
Loading

0 comments on commit 06cfbe6

Please sign in to comment.