Skip to content

Commit

Permalink
Merge pull request #177 from KxSystems/KXI-27841
Browse files Browse the repository at this point in the history
KXI-27841 Repo cleanup, adding contribution guides
  • Loading branch information
nfarrell-kx authored Nov 1, 2023
2 parents a257ca6 + b9e2cd6 commit ddee285
Show file tree
Hide file tree
Showing 11 changed files with 322 additions and 74 deletions.
39 changes: 39 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing to kdb VS Code Extension

Your input is very welcome, some examples of this include:

- Reporting a bug
- Submitting a fix
- Proposing new features

## Reporting a bug

Bugs can be reported via [Issues](https://github.com/KxSystems/kx-vscode/issues)

Where possible include:

- Quick summary and/or background
- Steps to reproduce
- Be specific
- Provide sample code if you can
- What you expected would happen
- What actually happens
- Other relevant notes

## Submitting a fix

Fixes can be submitted via a pull request:

1. Fork the repo and create your branch from `dev`
2. If you've added code that should be tested, add tests
3. Ensure the test suite passes, using `npm run test`
4. Apply the prettier formatting, using a plugin or manually using `npm run format`
5. Create a pull request for your branch

### License

When you submit code changes your submissions are understood to be under the same [Apache 2.0](https://github.com/KxSystems/kx-vscode/blob/main/LICENSE) that covers the project. Please feel free to contact the maintainers if that's a concern.

## Proposing a new feature

Please use [email protected] to raise any questions, feature requests or feedback.
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG.YML
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
projects: ["KxSystems/kx-vscode"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to complete this bug report
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. [email protected]
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of the extension are you running?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output (e.g. contents of the 'kdb' Output pane)
render: shell
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changes introduced by this PR

-
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md

This file was deleted.

240 changes: 201 additions & 39 deletions LICENSE

Large diffs are not rendered by default.

58 changes: 28 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ This is a companion extension for kdb developers to edit q files, connect to kdb

Please use [email protected] to raise any questions, issues or feedback.

<!--
[![KX VS Code CI Testing](https://github.com/KxSystems/kx-vscode/actions/workflows/ci.yml/badge.svg)](https://github.com/KxSystems/kx-vscode/actions/workflows/ci.yml)

[![KX VS Code Release](https://github.com/KxSystems/kx-vscode/actions/workflows/release.yml/badge.svg)](https://github.com/KxSystems/kx-vscode/actions/workflows/release.yml)
-->

## Contents

Expand Down Expand Up @@ -67,25 +65,25 @@ You can install q from the VS Code extension. You still need to register for [kd

**Step 1**: Click `Install new instance` from the prompt if no q installation is flagged. If this prompt is cancelled, then use the aforementioned [install q](#install-q).

![installnewinstance](https://code.kx.com/img/vscode/installnewinstance.jpg)
![installnewinstance](https://github.com/KxSystems/kx-vscode/blob/main/img/installnewinstance.jpg?raw=true)

**Step 2**: If you have already registered for kdb+ or kdb Insights, then choose `Select/Enter a license`. If you haven't registered, choose `Acquire license`, this will open a dialog with a redirect link to register for [kdb Insights Personal Edition](https://kx.com/kdb-insights-personal-edition-license-download/).

![findlicense](https://code.kx.com/img/vscode/findlicense.jpg)
![findlicense](https://github.com/KxSystems/kx-vscode/blob/main/img/findlicense.jpg?raw=true)

**Step 3**: With the license secured, you can then link this to VS Code by either `pasting license string` or `selecting license file` from your PC; the latter method is recommended for new users.

![findlicense](https://code.kx.com/img/vscode/pastelicense.jpg)
![findlicense](https://github.com/KxSystems/kx-vscode/blob/main/img/pastelicense.jpg?raw=true)

The base64 encoded license string can be found in the welcome email received after registration, under the download link for the license file.

![welcomeemaillicense](https://code.kx.com/img/vscode/weclomeemail.jpg)
![welcomeemaillicense](https://github.com/KxSystems/kx-vscode/blob/main/img/weclomeemail.jpg?raw=true)

The `k4.lic` or `kc.lic` license file can be downloaded to your PC.

**Step 4**: Set a [`QHOME` environment variable](https://code.kx.com/q/learn/install/#step-5-edit-your-profile) to the location used by the kdb VS Code install. A notification dialog displays the location of q, as do the extension [settings](#settings). This will allows you to use q outside of VSCode.

![qfound](https://code.kx.com/img/vscode/installationofqfound.jpg)
![qfound](https://github.com/KxSystems/kx-vscode/blob/main/img/installationofqfound.jpg?raw=true)

If q is installed at `C:\q`, then `QHOME` is `C:\q`.

Expand All @@ -101,11 +99,11 @@ The kdb VS Code extension allows you to connect VS Code to a q process; this can

**Step 2**: Within the kdb VS Code extension, click _connect to kdb server_, or *Add new connection\*\* from the *CONNECTIONS\* context menu.

![connecttoakdbserver](https://code.kx.com/img/vscode/connecttoakdbserver.png)
![connecttoakdbserver](https://github.com/KxSystems/kx-vscode/blob/main/img/connecttoakdbserver.png?raw=true)

**Step 3**: When prompted to select the kdb type, choose **Enter a kdb endpoint**.

![setendpoint](https://code.kx.com/img/vscode/step1connecttoakdbserver.jpg)
![setendpoint](https://github.com/KxSystems/kx-vscode/blob/main/img/step1connecttoakdbserver.jpg?raw=true)

**Step 4**: Assign a _server name / alias_. The server name selected **cannot be `local` or `insights`**, as these are reserved for use by [managed q sessions](#managed-q-session) and [kdb Insights Enterprise connections](#kdb-insights-enterprise); e.g. _dev_

Expand All @@ -117,11 +115,11 @@ The kdb VS Code extension allows you to connect VS Code to a q process; this can

Upon completion, the localhost connection appears under _KX:CONNECTIONS_ in the left hand panel.

![localkdbconnection](https://code.kx.com/img/vscode/localkdbconnection.jpg)
![localkdbconnection](https://github.com/KxSystems/kx-vscode/blob/main/img/localkdbconnection.jpg?raw=true)

**Step 7**: Right-click the connection to _connect kdb server_. Ensure the q process is running.

![localkdbconnection](https://code.kx.com/img/vscode/connectserver.jpg)
![localkdbconnection](https://github.com/KxSystems/kx-vscode/blob/main/img/connectserver.jpg?raw=true)

If authentication is required to access the connection, from the connection dropdown menu, add the required _username_ and the _password_, clicking Enter to move between the two.

Expand All @@ -135,11 +133,11 @@ This runs a q session using the existing kdb installed as part of the kdb VS Cod

**Step 1**: Click _connect to kdb server_ or _Add new connection_ from the _CONNECTIONS_ context menu.

![connecttoakdbserver](https://code.kx.com/img/vscode/connecttoakdbserver.png)
![connecttoakdbserver](https://github.com/KxSystems/kx-vscode/blob/main/img/connecttoakdbserver.png?raw=true)

**Step 2**: When prompted to select the kdb type, choose **Enter a kdb endpoint**.

![setendpoint](https://code.kx.com/img/vscode/step1connecttoakdbserver.jpg)
![setendpoint](https://github.com/KxSystems/kx-vscode/blob/main/img/step1connecttoakdbserver.jpg?raw=true)

**Step 3**: Set the _server name / alias_ to `local`.

Expand All @@ -151,7 +149,7 @@ This runs a q session using the existing kdb installed as part of the kdb VS Cod

**Step 6**: Right-click the managed q process listed under _KX:CONNECTIONS_, and click _Start q process_.

![setendpoint](https://code.kx.com/img/vscode/managedqprocess.jpg)
![setendpoint](https://github.com/KxSystems/kx-vscode/blob/main/img/managedqprocess.jpg?raw=true)

**Step 7**: From the same right-click menu, click _Connect kdb server_. This connects to the child q process running inside the kdb VS Code extension.

Expand All @@ -163,27 +161,27 @@ For kdb Insights Enterprise, the kdb VS Code extension is using a shared kdb pro

**Step 1**: Click _connect to kdb server_.

![connecttoakdbserver](https://code.kx.com/img/vscode/connecttoakdbserver.png)
![connecttoakdbserver](https://github.com/KxSystems/kx-vscode/blob/main/img/connecttoakdbserver.png?raw=true)

**Step 2**: When prompted to select a kdb type, choose _Connect to kdb insights_

![connecttoinsights](https://code.kx.com/img/vscode/connecttoinsights.jpg)
![connecttoinsights](https://github.com/KxSystems/kx-vscode/blob/main/img/connecttoinsights.jpg?raw=true)

**Step 3**: Create a _server name / alias_; this can be any name, aside from `local`, which is used by the [managed q session](#managed-q-session).

**Step 4**: Set the _hostname_. This is the remote address of your kdb Insights Enterprise deployment: e.g `https://mykdbinsights.cloudapp.azure.com`

**Step 5**: The kdb Insights Enterprise connection is listed under _KX:Connections_, with its own icon. Right-click the connection and _Connect to Insights_

![connecttoinsights](https://code.kx.com/img/vscode/kdbinsightsconnection.jpg)
![connecttoinsights](https://github.com/KxSystems/kx-vscode/blob/main/img/kdbinsightsconnection.jpg?raw=true)

**Step 6**: The kdb VS Code extension runs an authentication step with the remote kdb Insights Enterprise process; sign-in to kdb Insights Enterprise.

![authenticateinsights](https://code.kx.com/img/vscode/insightsauthenticate.jpg)
![authenticateinsights](https://github.com/KxSystems/kx-vscode/blob/main/img/insightsauthenticate.jpg?raw=true)

After a successful connection to a kdb Insights Enterprise process, a new _DATA SOURCES_ panel will become available in the kdb VS Code extension.

![insightsdatasources](https://code.kx.com/img/vscode/datasources.jpg)
![insightsdatasources](https://github.com/KxSystems/kx-vscode/blob/main/img/datasources.jpg?raw=true)

Once connected to a q process, go to [execute code](#execute-code).

Expand All @@ -201,9 +199,9 @@ A kdb language server is bundled with the kdb VS Code extension. It offers vario

The extension provides keyword syntax highlighting, comments and linting help.

![Syntax Highlighting](https://code.kx.com/img/vscode/syntax-highlighting.png)
![Syntax Highlighting](https://github.com/KxSystems/kx-vscode/blob/main/img/syntax-highlighting.png?raw=true)

![Linting](https://code.kx.com/img/vscode/linting.png)
![Linting](https://github.com/KxSystems/kx-vscode/blob/main/img/linting.png?raw=true)

### Code navigation

Expand All @@ -217,15 +215,15 @@ While developing q scripts, the kdb VS Code extension supports:

View references of a function both on the side view and inline with the editor

![Find all references](https://code.kx.com/img/vscode/find-all-references.png)
![Find all references](https://github.com/KxSystems/kx-vscode/blob/main/img/find-all-references.png?raw=true)

![Go to References](https://code.kx.com/img/vscode/go-to-references.png)
![Go to References](https://github.com/KxSystems/kx-vscode/blob/main/img/go-to-references.png?raw=true)

### Code Completion

- Keyword auto complete for the q language

![Autocomplete](https://code.kx.com/img/vscode/autocomplete.png)
![Autocomplete](https://github.com/KxSystems/kx-vscode/blob/main/img/autocomplete.png?raw=true)

- Autocomplete for local and remotely connected q processes

Expand Down Expand Up @@ -265,7 +263,7 @@ To create a data source:
1. Click on the created data source where the name, API and parameterization can be applied.
1. Click Save to persist the data source to the VS Code workspace.

![data Source](https://code.kx.com/img/vscode/data-source.png)
![data Source](https://github.com/KxSystems/kx-vscode/blob/main/img/data-source.png?raw=true)

To run a data source, click 'Run' and the results populate the output and kdb results windows.

Expand All @@ -283,7 +281,7 @@ To do this:

1. Return to VS Code and execute q code against the data in your scratchpad.

![Populate Scratchpad](https://code.kx.com/img/vscode/populate-scratchpad.png)
![Populate Scratchpad](https://github.com/KxSystems/kx-vscode/blob/main/img/populate-scratchpad.png?raw=true)

## View results

Expand All @@ -293,21 +291,21 @@ All query executions happen remotely from the kdb VS Code extension either again

The output view displays results as they are received by the kdb VS Code extension. It includes the query executed, a timestamp and the results.

![Output view](https://code.kx.com/img/vscode/output-results.png)
![Output view](https://github.com/KxSystems/kx-vscode/blob/main/img/output-results.png?raw=true)

**Note:** You can enable/disable auto-scrolling in the VS Code settings. This setting determines whether the output view scrolls to the latest results.

![Output autoscrolling](https://code.kx.com/img/vscode/auto-scrolling.png)
![Output autoscrolling](https://github.com/KxSystems/kx-vscode/blob/main/img/auto-scrolling.png?raw=true)

**Note** You can hide or show the full details in the console output. Go to settings of the vscode, search for kdb, check the option "Hide Detailed Console Query Output" (this option is checked by default)

![Hide Detailed Console Query Output](https://code.kx.com/img/vscode/hide-detailed-console-query.png)
![Hide Detailed Console Query Output](https://github.com/KxSystems/kx-vscode/blob/main/img/hide-detailed-console-query.png?raw=true)

- A kdb results view

Results are displayed under the kdb results view, which shows the returned data in a table.

![kdb results view](https://code.kx.com/img/vscode/kdbview-results.png)
![kdb results view](https://github.com/KxSystems/kx-vscode/blob/main/img/kdbview-results.png?raw=true)

## Settings

Expand Down
Empty file removed SECURITY.md
Empty file.
1 change: 0 additions & 1 deletion SUPPORT.md

This file was deleted.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"vscode": "^1.66.0"
},
"icon": "resources/images/kx-logo-vs.png",
"repository": {
"type": "git",
"url": "https://github.com/KxSystems/kx-vscode.git"
},
"aiKey": "93119af7-5d98-45d0-abf8-5074976a1472",
"capabilities": {
"untrustedWorkspaces": {
Expand Down Expand Up @@ -583,6 +587,9 @@
}
},
"license": "MIT",
"bugs": {
"url": "https://github.com/KxSystems/kx-vscode/issues"
},
"homepage": "https://kx.com",
"scripts": {
"vscode:prepublish": "npm run -S esbuild-base -- --minify --keep-names",
Expand Down
6 changes: 3 additions & 3 deletions release_process.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Release process for KX VSCode extension
# Release process for kdb VS Code extension

On each push to Main or Dev there is a vsix built and uploaded to [Downloads Portal](https://portal.dl.kx.com/assets/raw/kdb-vscode/)
On each push to the `main` or `dev` branches` a VSIX file is built and uploaded to [Downloads Portal](https://portal.dl.kx.com/assets/raw/kdb-vscode/)

## Steps for creating a new release

1. Update the [package.json](package.json) to bump the version for the extension. This is important because when installing the package (VSIX), it's important to have the updated version to ensure VSCode does not install another version. This applies after the extension is published to the marketplace. This uses semantic version of build.release.patch (e.g., 0.1.8)
1. Update the [package.json](package.json) to bump the version for the extension. This is important because when installing the package (VSIX), it's important to have the updated version to ensure VSCode does not install another version. This uses semantic version of build.release.patch (e.g., 0.1.8)

2. Update the [CHANGELOG.md](CHANGELOG.md) to include the release version the the appropriate comments on updates. This uses semantic version of build.release.patch (e.g., v0.1.8)

Expand Down

0 comments on commit ddee285

Please sign in to comment.