Skip to content

Commit b8cbf7a

Browse files
Fix formatting issues and remove unused code
1 parent 75c201e commit b8cbf7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3364
-535
lines changed

CONTRIBUTING.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing to Pine-Script-v5-VS-Code
2+
3+
👋 Welcome, and thank you for considering contributing to Pine-Script-v5-VS-Code! Your help is essential for keeping it great.
4+
5+
## Code of Conduct
6+
7+
Please note we have a code of conduct, please follow it in all your interactions with the project.
8+
9+
## How Can I Contribute?
10+
11+
### Reporting Bugs
12+
13+
Before creating bug reports, please check the list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible by filling in the template. This helps maintainers and the community understand your report.
14+
15+
#### Before Submitting A Bug Report
16+
17+
* **Check the FAQs** for a list of common questions and problems.
18+
* **Perform a cursory search** to see if the problem has already been reported.
19+
20+
#### How Do I Submit A Good Bug Report?
21+
22+
Bugs are tracked as GitHub issues. Create an issue and provide the necessary information by filling in the template.
23+
24+
### Suggesting Enhancements
25+
26+
This section guides you through submitting an enhancement suggestion for Pine-Script-v5-VS-Code, including new features and minor improvements to existing functionality.
27+
28+
Before creating enhancement suggestions, please check the list as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please include as many details as possible by filling in the template.
29+
30+
### Your First Code Contribution
31+
32+
Unsure where to begin contributing to Pine-Script-v5-VS-Code? You can start by looking through these `beginner` and `help-wanted` issues.
33+
34+
### Pull Requests
35+
36+
Here are some steps to guide you through the process:
37+
38+
1. Follow all instructions in the pull request template.
39+
2. Follow the styleguides.
40+
41+
## Styleguides
42+
43+
### Git Commit Messages
44+
45+
* Use the present tense ("Add feature" not "Added feature")
46+
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
47+
* Limit the first line to 72 characters or less
48+
* Reference issues and pull requests liberally after the first line
49+
50+
### TypeScript/JavaScript Styleguide
51+
52+
All TypeScript/JavaScript must adhere to the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
53+
54+
* Prefer `const` and `let` over `var`
55+
* Use template strings instead of concatenation
56+
* Use imports and exports (`import`/`export`) over `require`
57+
58+
### Documentation Styleguide
59+
60+
* Use [Markdown](https://daringfireball.net/projects/markdown/)
61+
* Use `-` for unordered lists
62+
* Include the language for code blocks
63+
64+
## Additional Notes
65+
66+
* Issue and pull request labels - This link will take you to a page that explains what each label on GitHub issues and pull requests mean.
67+
68+
We are excited to have you join our community and look forward to your contributions!

Pine_Script_Documentation/pineDocs.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16402,7 +16402,7 @@
1640216402
{
1640316403
"name": "precision",
1640416404
"info": "Specifies the number of digits after the floating point of the script\\`s displayed values. \nMust be a non-negative integer no greater than 16. \nIf `format` is set to [format.inherit](#var_format.inherit) and `precision` is specified, the format will instead be set to [format.price](#var_format.price). \nOptional. The default is inherited from the precision of the chart\\`s symbol.",
16405-
"default": "syminfo.pricescale",
16405+
"default": "na",
1640616406
"required": false,
1640716407
"displayType": "const int",
1640816408
"allowedTypeIDs": [
@@ -16452,7 +16452,7 @@
1645216452
{
1645316453
"name": "timeframe",
1645416454
"info": "Adds multi-timeframe functionality to simple scripts. When used, a \"Timeframe\" field will be added to the script\\`s \"Settings/Inputs\" tab. \nThe field\\`s default value will be the argument supplied, whose format must conform to [timeframe string specifications](https://www.tradingview.com/pine-script-docs/en/v5/concepts/Timeframes.html#timeframe-string-specifications). \nTo specify the chart\\`s timeframe, use an empty string or the [timeframe.period](#var_timeframe.period) variable. \nThe parameter cannot be used with scripts using Pine Script™ drawings. \nOptional. The default is [timeframe.period](#var_timeframe.period).",
16455-
"default": "timeframe.period",
16455+
"default": "\"\"",
1645616456
"required": false,
1645716457
"displayType": "const string",
1645816458
"allowedTypeIDs": [
@@ -16499,7 +16499,7 @@
1649916499
{
1650016500
"name": "max_lines_count",
1650116501
"info": "The number of last [line](#op_line) drawings displayed. \nPossible values: 1-500. \nThe count is approximate; more drawings than the specified count may be displayed. \nOptional. The default is 50.",
16502-
"default": 50,
16502+
"default": "50",
1650316503
"required": false,
1650416504
"displayType": "const int",
1650516505
"allowedTypeIDs": [
@@ -16515,7 +16515,7 @@
1651516515
{
1651616516
"name": "max_labels_count",
1651716517
"info": "The number of last [label](#op_label) drawings displayed. \nPossible values: 1-500. \nThe count is approximate; more drawings than the specified count may be displayed. \nOptional. The default is 50.",
16518-
"default": 50,
16518+
"default": "50",
1651916519
"required": false,
1652016520
"displayType": "const int",
1652116521
"allowedTypeIDs": [
@@ -16531,7 +16531,7 @@
1653116531
{
1653216532
"name": "max_boxes_count",
1653316533
"info": "The number of last [box](#op_box) drawings displayed. \nPossible values: 1-500. \nThe count is approximate; more drawings than the specified count may be displayed. \nOptional. The default is 50.",
16534-
"default": 50,
16534+
"default": "50",
1653516535
"required": false,
1653616536
"displayType": "const int",
1653716537
"allowedTypeIDs": [
@@ -16547,7 +16547,7 @@
1654716547
{
1654816548
"name": "max_polylines_count",
1654916549
"info": "The number of last [polyline](#op_polyline) drawings displayed. \nPossible values: 1-100. The count is approximate; more drawings than the specified count may be displayed. Optional. The default is 50.",
16550-
"default": 50,
16550+
"default": "50",
1655116551
"required": false,
1655216552
"displayType": "const int",
1655316553
"allowedTypeIDs": [
@@ -21612,7 +21612,7 @@
2161221612
{
2161321613
"name": "max",
2161421614
"info": "The upper bound of the range of random values. The value is not included in the range. \nThe default is 1.",
21615-
"default": 1,
21615+
"default": "1",
2161621616
"required": false,
2161721617
"displayType": "series int|float",
2161821618
"allowedTypeIDs": [
@@ -27704,7 +27704,7 @@
2770427704
{
2770527705
"name": "default_qty_value",
2770627706
"info": "The default quantity to trade, in units determined by the argument used with the `default_qty_type` parameter. \nThis setting can also be changed in the strategy\\`s \"Settings/Properties\" tab. \nOptional. The default is 1.",
27707-
"default": 1,
27707+
"default": "1",
2770827708
"required": false,
2770927709
"displayType": "const int|float",
2771027710
"allowedTypeIDs": [
@@ -27873,7 +27873,7 @@
2787327873
{
2787427874
"name": "max_lines_count",
2787527875
"info": "The number of last [line](#op_line) drawings displayed. \nPossible values: 1-500. \nOptional. The default is 50.",
27876-
"default": 50,
27876+
"default": "50",
2787727877
"required": false,
2787827878
"displayType": "const int",
2787927879
"allowedTypeIDs": [
@@ -27889,7 +27889,7 @@
2788927889
{
2789027890
"name": "max_labels_count",
2789127891
"info": "The number of last [label](#op_label) drawings displayed. \nPossible values: 1-500. \nOptional. The default is 50.",
27892-
"default": 50,
27892+
"default": "50",
2789327893
"required": false,
2789427894
"displayType": "const int",
2789527895
"allowedTypeIDs": [
@@ -27905,7 +27905,7 @@
2790527905
{
2790627906
"name": "max_boxes_count",
2790727907
"info": "The number of last [box](#op_box) drawings displayed. \nPossible values: 1-500. \nOptional. The default is 50.",
27908-
"default": 50,
27908+
"default": "50",
2790927909
"required": false,
2791027910
"displayType": "const int",
2791127911
"allowedTypeIDs": [
@@ -27921,7 +27921,7 @@
2792127921
{
2792227922
"name": "risk_free_rate",
2792327923
"info": "The risk-free rate of return is the annual percentage change in the value of an investment with minimal or zero risk. \nIt is used to calculate the [Sharpe and Sortino ratios](https://www.tradingview.com/chart/?solution=43000561856). \nOptional. The default is 2.",
27924-
"default": 2,
27924+
"default": "2",
2792527925
"required": false,
2792627926
"displayType": "const int|float",
2792727927
"allowedTypeIDs": [
@@ -27957,7 +27957,7 @@
2795727957
{
2795827958
"name": "max_polylines_count",
2795927959
"info": "The number of last [polyline](#op_polyline) drawings displayed. \nPossible values: 1-100. The count is approximate; more drawings than the specified count may be displayed. Optional. The default is 50.",
27960-
"default": 50,
27960+
"default": "50",
2796127961
"required": false,
2796227962
"displayType": "const int",
2796327963
"allowedTypeIDs": [
@@ -28038,7 +28038,7 @@
2803828038
{
2803928039
"name": "limit",
2804028040
"info": "An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.",
28041-
"default": 1,
28041+
"default": "1",
2804228042
"required": false,
2804328043
"displayType": "series int|float",
2804428044
"allowedTypeIDs": [
@@ -28195,7 +28195,7 @@
2819528195
{
2819628196
"name": "qty",
2819728197
"info": "An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.",
28198-
"default": 1,
28198+
"default": "1",
2819928199
"required": false,
2820028200
"displayType": "series int|float",
2820128201
"allowedTypeIDs": [
@@ -28388,7 +28388,7 @@
2838828388
{
2838928389
"name": "qty_percent",
2839028390
"info": "Defines the percentage of (0-100) the position to close. Its priority is lower than that of the 'qty' parameter. \nOptional. The default is 100.",
28391-
"default": 100,
28391+
"default": "100",
2839228392
"required": false,
2839328393
"displayType": "series int|float",
2839428394
"allowedTypeIDs": [
@@ -29549,7 +29549,7 @@
2954929549
{
2955029550
"name": "border_width",
2955129551
"info": "Width of the four borders, in pixels. Optional. The default is 1 pixel.",
29552-
"default": 1,
29552+
"default": "1",
2955329553
"required": false,
2955429554
"displayType": "series int",
2955529555
"allowedTypeIDs": [
@@ -30992,7 +30992,7 @@
3099230992
{
3099330993
"name": "width",
3099430994
"info": "Line width in pixels.",
30995-
"default": 1,
30995+
"default": "1",
3099630996
"required": false,
3099730997
"displayType": "series int",
3099830998
"allowedTypeIDs": [

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11

2-
# Pine Script v5 Language Server for Visual Studio Code
2+
<h1 align="center">Pine Script v5 Language Server for VS Code</h1>
3+
4+
<p align="center">
5+
<a><img src="https://img.shields.io/github/package-json/v/FFriZ/Pine-Script-v5-VS-Code?color=green&style=flat-square" alt="Version"></a>
6+
<a><img src="https://img.shields.io/github/issues/FFriZ/Pine-Script-v5-VS-Code?style=flat-square" alt="Issues"></a>
7+
<a><img src="https://img.shields.io/visual-studio-marketplace/i/frizlabz.pinescript?color=red&style=flat-square" alt="Downloads"></a>
8+
<a><img src="https://img.shields.io/github/stars/FFriZ/Pine-Script-v5-VS-Code?color=red&style=flat-square" alt="Stars"></a>
9+
<a><img src="https://img.shields.io/github/contributors/FFriZ/Pine-Script-v5-VS-Code?color=green&style=flat-square" alt="Contributors"></a>
10+
<a><img src="https://img.shields.io/github/license/FFriZ/Pine-Script-v5-VS-Code?style=flat-square" alt="Licance"></a>
11+
</p>
312

413
> Disclaimer: Pine Script™ is a trademark of TradingView. This project is not affiliated with, endorsed by, or connected to TradingView.
514
615

16+
17+
18+
19+
720
The Pine Script v5 Language Server Extension is a powerful addition to your VS Code setup, designed specifically to enhance the development experience for Pine Script v5. It brings a suite of advanced features to your fingertips, including robust syntax highlighting and intelligent code completion, which greatly facilitate the coding process. While TradingView offers an excellent domain-specific text editor, it lacks the level of customization that some users may desire. The advent of AI technology presents an opportunity to harness these tools to accelerate the production speed. This potential was one of my motivations for developing this extension. Furthermore, VS Code is on the cusp of releasing API features that will allow the creation of custom copilot agents, a capability already available in the insiders edition, which could provide additional impetus for using this extension. My aspiration is that the Pine Script community finds great value and utility in this tool, as its development has been a significant endeavor.
821

922

@@ -138,4 +151,7 @@ Skilled in Full Stack Development and Node.js, and an expert in Pine Script.
138151

139152
For inquires: [email protected]
140153

141-
Support my work: [Buy me a coffee](https://www.buymeacoffee.com/frizlabz)
154+
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/FrizLabz)](https://twitter.com/FrizLabz)
155+
156+
Support my work:
157+
[![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/default-orange.png)](https://www.buymeacoffee.com/frizlabz)

README_INSTALLATION.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
### **Building from Source**
2+
3+
To build the Pine Script v5 Language Server extension from source, follow these steps:
4+
5+
#### Prerequisites
6+
Before you begin, ensure you have the following installed:
7+
- [Node.js](https://nodejs.org/) (which includes npm)
8+
- [Git](https://git-scm.com/)
9+
- [Visual Studio Code](https://code.visualstudio.com/)
10+
11+
#### Step 1: Clone the Repository
12+
Clone the repository to your local machine using Git:
13+
14+
```bash
15+
git clone https://github.com/FFriZ/Pine-Script-v5-VS-Code.git
16+
cd Pine-Script-v5-VS-Code
17+
```
18+
19+
**or:**
20+
21+
Within VS Code open the command palette by going to
22+
23+
view > command palette
24+
or:
25+
26+
press CTRL+SHIFT+P
27+
28+
29+
then:
30+
31+
type "clone" > press "Enter" > paste the repo url > select a dir location then open the new cloned repo when prompted.
32+
33+
#### Step 2: Install Dependencies
34+
Navigate to the cloned directory and install the necessary dependencies (If you used VS Code in step #1 then you will be in the cloned directory and can use the VS Code terminal press **CTRL+`** to show terminal):
35+
36+
```bash
37+
npm install
38+
```
39+
40+
#### Step 3: Compile the Code
41+
Compile the TypeScript code into JavaScript:
42+
43+
```bash
44+
npm run compile
45+
```
46+
47+
#### Step 4: Open in Visual Studio Code
48+
Open the folder in Visual Studio Code (Can skip if you are already in the dir inside of VS Code.):
49+
50+
```bash
51+
code .
52+
```
53+
54+
#### Step 5: Run the Extension
55+
In VS Code, press `F5` to run the extension in a new Extension Development Host window.
56+
57+
#### Step 6: Package the Extension (Optional)
58+
If you want to package the extension into a `.vsix` file:
59+
60+
1. Install `vsce`, the Visual Studio Code Extension CLI:
61+
62+
```bash
63+
npm install -g vsce
64+
```
65+
66+
2. Package the extension:
67+
68+
```bash
69+
vsce package
70+
```
71+
72+
This will create a `.vsix` file in your directory that you can distribute or install manually using the Extensions view in VS Code.
73+
74+
#### Additional Notes
75+
- Make sure to update the version number in `package.json` if you are making changes and plan to release a new version.
76+
- If you encounter any issues during the build process, check the `scripts` section of `package.json` for custom commands used by the project.
77+
- Refer to the `CONTRIBUTING.md` file in the repository for more detailed instructions on contributing to the project.
78+
79+
By following these instructions, you should be able to successfully build the Pine Script v5 Language Server extension from source.

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

docs/assets/highlight.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
:root {
2+
--light-hl-0: #001080;
3+
--dark-hl-0: #9CDCFE;
4+
--light-hl-1: #000000;
5+
--dark-hl-1: #D4D4D4;
6+
--light-code-background: #FFFFFF;
7+
--dark-code-background: #1E1E1E;
8+
}
9+
10+
@media (prefers-color-scheme: light) { :root {
11+
--hl-0: var(--light-hl-0);
12+
--hl-1: var(--light-hl-1);
13+
--code-background: var(--light-code-background);
14+
} }
15+
16+
@media (prefers-color-scheme: dark) { :root {
17+
--hl-0: var(--dark-hl-0);
18+
--hl-1: var(--dark-hl-1);
19+
--code-background: var(--dark-code-background);
20+
} }
21+
22+
:root[data-theme='light'] {
23+
--hl-0: var(--light-hl-0);
24+
--hl-1: var(--light-hl-1);
25+
--code-background: var(--light-code-background);
26+
}
27+
28+
:root[data-theme='dark'] {
29+
--hl-0: var(--dark-hl-0);
30+
--hl-1: var(--dark-hl-1);
31+
--code-background: var(--dark-code-background);
32+
}
33+
34+
.hl-0 { color: var(--hl-0); }
35+
.hl-1 { color: var(--hl-1); }
36+
pre, code { background: var(--code-background); }

0 commit comments

Comments
 (0)