Skip to content

Commit

Permalink
Merge + prepare for 0.9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
APerricone committed Jun 3, 2020
2 parents a74287c + 4d0dec5 commit c60acbd
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 44 deletions.
17 changes: 14 additions & 3 deletions client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Change Log
All notable changes to the "Harbour and xHarbour" extension will be documented in this file.

# 0.9.11
# 0.9.12
- **debugger** better stability
- **task** better stability
- **task** correct management of batch option

# 0.9.11
- **server** fixes case of unfound parent [#57](https://github.com/APerricone/harbourCodeExtension/issues/57)
- **syntax** fixes [memvar aliasing syntax highlighting #58](https://github.com/APerricone/harbourCodeExtension/issues/58),
[Multiline "inline" class methods syntax highlighting #59](https://github.com/APerricone/harbourCodeExtension/issues/59),
[Try catch syntax highlighting #60](https://github.com/APerricone/harbourCodeExtension/issues/60) by [Edgard Lorraine Messias](https://github.com/edgardmessias)
- **debugger** better step out and step next support
- **server** better code folding see [#56](https://github.com/APerricone/harbourCodeExtension/issues/56)
- **task** added temporary variable solver waiting for [VSCode #81007](https://github.com/microsoft/vscode/issues/81007)

Many thanks to [Seth Hovestol](https://github.com/Hovestar) for bug reportinh

# 0.9.10
- **debugger** added process list on attach, attach by process Id
- **task** added Harbour and HBMK2 tasks, BETA
Expand Down Expand Up @@ -63,13 +74,13 @@ All notable changes to the "Harbour and xHarbour" extension will be documented i

# 0.9.0
- **server** add hover for defines
- **syntax** a lot of fixes by [Edgard Lorraine Messias](mailto:edgardmessias@gmail.com)
- **syntax** a lot of fixes by [Edgard Lorraine Messias](https://github.com/edgardmessias)
- **server** added information about class during completition

# 0.8.12
- **debugger** Added options for error management
- **server** Fix some crash
- **syntax** use of [Edgard Lorraine Messias](mailto:edgardmessias@gmail.com) syntax
- **syntax** use of [Edgard Lorraine Messias](https://github.com/edgardmessias) syntax
- **server** Fixed deletion of wrong fields

# 0.8.10 - 0.8.11
Expand Down
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ do you like this extension? Help me to make it better with a donation, click the

## Features

- [syntax hightlight](https://github.com/APerricone/harbourCodeExtension/wiki/Syntax-hightlight), with [Edgard Lorraine Messias](mailto:edgardmessias@gmail.com)
- [syntax hightlight](https://github.com/APerricone/harbourCodeExtension/wiki/Syntax-hightlight), with [Edgard Lorraine Messias](https://github.com/edgardmessias)
- [Debug support](https://github.com/APerricone/harbourCodeExtension/wiki/Debugger)
- [Diagnostic infos](https://github.com/APerricone/harbourCodeExtension/wiki/Diagnostics-Lint)
- Symbol Definitions Within a Document provider (access it by pressing <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>O</kbd> or <kbd>CTRL</kbd>+<kbd>P</kbd> then <kbd>@</kbd>)
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "harbour",
"displayName": "Harbour and xHarbour",
"description": "Harbour and xHarbour languages support for visual studio code",
"version": "0.9.11",
"version": "0.9.12",
"publisher": "aperricone",
"icon": "harbourIcon.png",
"main": "./dist/extension",
Expand Down
151 changes: 123 additions & 28 deletions client/syntaxes/harbour.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
},
"variable-memvar-declaration": {
"name": "meta.definition.variable.memvar.harbour",
"begin": "(?i)^\\s*memv(?:a(?:r)?)?\\b",
"begin": "(?i)^\\s*memv(?:a(?:r)?)?\\b(?!->)",
"beginCaptures": {
"0": {
"name": "storage.type.memvar.harbour"
Expand All @@ -390,19 +390,33 @@
]
},
"variable-field-declaration": {
"match": "(?i)^\\s*(_?field?)\\s*(->)\\s*([a-z0-9_]+)",
"captures": {
"1": {
"name": "meta.definition.variable.memvar.harbour",
"begin": "(?i)^\\s*_?field?\\b(?!->)",
"beginCaptures": {
"0": {
"name": "storage.type.field.harbour"
}
},
"end": "(?m:$)",
"patterns": [{
"include": "#continue-expression"
},
"2": {
"name": "keyword.accessor.harbour"
{
"include": "#comments"
},
"3": {
"name": "meta.definition.variable.field.harbour"
{
"name": "keyword.in.harbour",
"match": "(?i)\\bIN\\b"
},
{
"name": "variable.other.readwrite.field.harbour",
"match": "(?i)\\b([A-Z_]\\w*)\\b"
},
{
"include": "#punctuation-comma"
}
}
},
]
},
"variable-local-declaration": {
"name": "meta.definition.variable.local.harbour",
"begin": "(?i)^\\s*(loca(?:l)?)\\b",
Expand Down Expand Up @@ -616,20 +630,26 @@
}
]
},
{
"include": "#inline-method-declaration"
},
{
"include": "#method-declaration"
},
{
"match": "^\\s*(export(?:ed)?|visible|hidden|protected):",
"match": "(?i)^\\s*(export(?:ed)?|visible|hidden|private|protected)(:)",
"captures": {
"1": {
"name": "storage.modifier.harbour"
},
"2": {
"name": "punctuation.separator.colon.harbour"
}
}
},
{
"name": "meta.field.declaration.harbour",
"begin": "(?i)^\\s*(?:class)?(data|var)\\b",
"begin": "(?i)^\\s*(?:class)?(data|var|access)\\b",
"beginCaptures": {
"0": {
"name": "storage.type.field.harbour"
Expand Down Expand Up @@ -658,7 +678,7 @@
}
},
{
"begin": "(?i)(assign|init)\\s+",
"begin": "(?i)(assign|init|inline)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.control.${1:/downcase}.harbour"
Expand All @@ -684,13 +704,43 @@
]
}]
},
"inline-method-declaration": {
"patterns": [{
"name": "meta.inline-method.declaration.harbour",
"begin": "(?i)^\\s*(inline)\\s*(method)\\b",
"beginCaptures": {
"1": {
"name": "constant.language.inline.harbour"
},
"2": {
"name": "keyword.type.method.harbour"
}
},
"end": "(?i)END[\\t ]*METHOD",
"endCaptures": {
"0": {
"name": "keyword.end.class.harbour"
}
},
"patterns": [{
"include": "#continue-expression"
},
{
"include": "#comments"
},
{
"include": "#function-staments"
}
]
}]
},
"method-declaration": {
"patterns": [{
"name": "meta.method.declaration.harbour",
"begin": "(?i)^\\s*(method)\\b",
"begin": "(?i)^\\s*(assign|method)\\b",
"beginCaptures": {
"1": {
"name": "keyword.type.method.harbour"
"name": "keyword.type.${1:/downcase}.harbour"
}
},
"end": "(?m:$)",
Expand Down Expand Up @@ -948,23 +998,55 @@
}]
},
"macro-var": {
"patterns": [{
"name": "meta.macro-var.harbour",
"match": "(?i)(&)([a-zA-Z_][a-zA-Z0-9_]*)(\\.)?",
"captures": {
"1": {
"name": "punctuation.definition.macro.begin.harbour"
},
"3": {
"name": "punctuation.definition.macro.end.harbour"
"name": "meta.macro-var.harbour",
"begin": "(?i)(&)([a-zA-Z_][a-zA-Z0-9_]*)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.macro-var.harbour"
},
"2": {
"name": "entity.other.attribute-name.macro.harbour"
}
},
"end": "(?=[^.\\w])",
"patterns": [
{
"match": "(\\.)",
"captures": {
"1": {
"name": "punctuation.accessor.harbour"
}
}
},
{
"match": "(\\w)",
"captures": {
"1": {
"name": "variable.other.property.harbour"
}
}
}
}]
]
},
"macro-exp": {
"name": "meta.macro-exp.harbour",
"begin": "(?i)(&)(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.definition.macro-exp.harbour"
},
"2": {
"name": "punctuation.definition.begin.bracket.round.harbour"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.end.bracket.round.harbour"
}
},
"patterns": [{
"name": "punctuation.definition.macro.harbour",
"match": "(?i)(&)(?=\\()"
"include": "#inline-staments"
}]
},
"keywords": {
Expand All @@ -973,6 +1055,7 @@
{ "name": "keyword.announce.harbour", "match": "\\b(?i:anno(?:u(?:n(?:ce?)?)?)?)\\b" },
{ "name": "keyword.begin.harbour", "match": "\\b(?i:begin?\\s+sequ(?:e(?:n(?:ce?)?)?)?)\\b" },
{ "name": "keyword.break.harbour", "match": "\\b(?i:break?)\\b" },
{ "name": "keyword.catch.harbour", "match": "\\b(?i:catch?)\\b" },
{ "name": "keyword.case.harbour", "match": "\\b(?i:case)\\b" },
{ "name": "keyword.declare.harbour", "match": "\\b(?i:decl(?:a(?:re?)?)?)\\b" },
{ "name": "keyword.descend.harbour", "match": "\\b(?i:descend)\\b" },
Expand All @@ -989,6 +1072,8 @@
{ "name": "keyword.end.harbour", "match": "\\b(?i:end)\\b" },
{ "name": "keyword.exit.harbour", "match": "\\b(?i:exit)\\b" },
{ "name": "keyword.external.harbour", "match": "\\b(?i:exte(?:r(?:n(?:al?)?)?)?)\\b" },
{ "name": "keyword.field.harbour", "match": "\\b(?i:field?)\\b" },
{ "name": "keyword.finally.harbour", "match": "\\b(?i:fina(?:l(?:ly?)?)?)\\b" },
{ "name": "keyword.for.harbour", "match": "\\b(?i:for(?:\\s+each)?)\\b" },
{ "name": "keyword.function.harbour", "match": "\\b(?i:func(?:t(?:i(?:on?)?)?)?)\\b" },
{ "name": "keyword.if.harbour", "match": "\\b(?i:if)\\b" },
Expand All @@ -1014,6 +1099,8 @@
{ "name": "keyword.switch.harbour", "match": "\\b(?i:swit(?:ch?)?)\\b" },
{ "name": "keyword.thread.harbour", "match": "\\b(?i:thre(?:ad?)?)\\s+stat(?:ic?)?\\b" },
{ "name": "keyword.to.harbour", "match": "\\b(?i:to)\\b" },
{ "name": "keyword.throw.harbour", "match": "\\b(?i:throw?)\\b" },
{ "name": "keyword.try.harbour", "match": "\\b(?i:try)\\b" },
{ "name": "keyword.while.harbour", "match": "\\b(?i:while?)\\b" },
{ "name": "keyword.with.harbour", "match": "\\b(?i:with\\s+obje(?:ct?)?)\\b" },
{ "name": "keyword._hb_class.harbour", "match": "\\b(?i:_hb_class)\\b" },
Expand All @@ -1037,7 +1124,15 @@
},
{
"name": "keyword.accessor.harbour",
"match": "->"
"match": "(->)(\\w+)?",
"captures": {
"1": {
"name": "keyword.accessor.harbour"
},
"2": {
"name": "variable.other.property.harbour"
}
}
},
{
"name": "keyword.operator.logical.harbour",
Expand Down
3 changes: 3 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"version": "0.5.0",
"author": "aperricone",
"main": "dist/hb_server.js",
"bin": {
"hbLanguageServer": "dist/hb_server.js"
},
"license": "GPL",
"repository": {
"url": "https://github.com/APerricone/harbourCodeExtension"
Expand Down
24 changes: 18 additions & 6 deletions server/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,11 @@ function kindTOVS(kind, sk) {
return sk ? server.SymbolKind.Method : server.CompletionItemKind.Method;
case "data":
return sk ? server.SymbolKind.Property : server.CompletionItemKind.Property;
case "function":
case "procedure":
case "function*":
case "procedure*":
return sk ? server.SymbolKind.Interface : server.CompletionItemKind.Interface;
case "function":
case "procedure":
case "C-FUNC":
return sk ? server.SymbolKind.Function : server.CompletionItemKind.Function;
case "local":
Expand Down Expand Up @@ -372,7 +373,13 @@ connection.onDocumentSymbol((param) => {
var names = [];
while (pp) {
if (pp.kind == "method" && pp.foundLike == "definition" && (!pp.parent || pp.startLine > pp.parent.endLine)) {
names.push(pp.parent.name + ":" + pp.name);
if(pp.parent)
names.push(pp.parent.name + ":" + pp.name);

else if(pp.parentName)
names.push(pp.parentName+"???:" + pp.name);
else
names.push("???:" + pp.name);
break;
} else
names.push(pp.name);
Expand All @@ -389,9 +396,14 @@ connection.onDocumentSymbol((param) => {
}
}
} else
if (info.kind == "method" && info.parent)
docSym.name = info.parent.name + ":" + info.name

if (info.kind == "method") {
if(info.parent)
docSym.name = info.parent.name + ":" + info.name
else if(info.parentName)
docSym.name = info.parentName+"???:" + info.name;
else
docSym.name = "???:" + info.name;
}
parent.push(docSym);
//}
};
Expand Down
8 changes: 6 additions & 2 deletions server/src/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ function Info(name, kind, foundLike, parent, document, startLine, startCol, endL
/** @type {string} */
this.foundLike = foundLike;
/** @type {Info} */
this.parent = parent;
if(typeof(parent)=="string") {
this.parentName = parent;
this.parent = undefined;
} else
this.parent = parent;
/** @type {string} */
this.document = document;
/** @type {number} */
Expand Down Expand Up @@ -637,7 +641,7 @@ Provider.prototype.parseHarbour = function (words) {
}
if (r[5] && r[5].length) fLike = "definition";
if (this.currentMethod) this.currentMethod.endLine = this.lastCodeLine;
this.currentMethod = this.addInfo(r[2], 'method', fLike, this.currentClass);
this.currentMethod = this.addInfo(r[2], 'method', fLike, this.currentClass || r[4]);

if (r[3] && r[3].length)
this.parseDeclareList(r[3], "param", this.currentMethod);
Expand Down
2 changes: 1 addition & 1 deletion test/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"c:\\harbour32\\start.bat"
"c:\\harbour\\start64.bat"
]
}
Loading

0 comments on commit c60acbd

Please sign in to comment.