Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit be6a1f1339f1dfddd386dae5383adf431745a89b
Merge: eab731a9 86dabe8
Author: Michal Bali <michalbali32@gmail.com>
Date:   Wed Jan 29 10:17:01 2020 +0100

    Merge branch 'master-public-mine' into merged

commit eab731a9f213c80490ce598aae0043cc42332286
Merge: 2b30463f cf2600e
Author: Michal Bali <michalbali32@gmail.com>
Date:   Wed Jan 29 10:16:39 2020 +0100

    Merge remote-tracking branch 'main/master' into merged

commit 2b30463f7b6b9b6e34ef4a13ea8abada9cae95c8
Merge: 965eef13 2271454
Author: Michal Bali <michalbali32@gmail.com>
Date:   Wed Jan 29 10:14:09 2020 +0100

    Merge commit '2271454d0ca21a1bbd8cfeefd920c3ae6b0aa8ce' into merged

    # Conflicts:
    #	cmake/try_filesystem_link.cpp
    #	language_server/src/dap/tcp_handler.cpp
    #	language_server/src/dap/tcp_handler.h
    #	language_server/src/stream_helper.h

commit cf2600e
Author: Marcel Hruska <marcel.hruska@broadcom.com>
Date:   Fri Jan 24 16:35:42 2020 +0100

    Performance Improvements vol.2 (eclipse-che4z#80)

    * preparation for hl test
    * Revert "preparation for hl test"
    This reverts commit 098a08c0fab1c34f65602280de8b517c441e3f2a.
    * merge fix
    * latest pull req suggestions
    * reworked variants to templates
    * lazy documentation loading
    * ajds to lazy documentation
    * changes
    * added tests for server features
    * fixed test paths

commit 82587a0
Author: Michal Bali <michal.bali@broadcom.com>
Date:   Tue Jan 14 10:50:47 2020 +0100

    DAP listen on localhost (eclipse-che4z#79)

commit 04a78d3
Author: Marcel Hruska <marcel.hruska@broadcom.com>
Date:   Fri Jan 10 10:26:50 2020 +0100

    small updates to package.json (eclipse-che4z#77)

commit 9b88837
Author: Zeibura Kathau <zeibura.kathau@broadcom.com>
Date:   Thu Jan 9 11:46:48 2020 +0100

    Readme update (eclipse-che4z#75)

    * Update README.md
    Getting started done
    * Update README.md
    features done
    * CA - Conditional Assembly
    * address comments
    * some edits to "macro tracer config"
    * ### Macro Tracer Configuration done
    * ### External Macro Libraries and COPY Members
    * more to last section
    more clarifications, rescue example case from previous readme
    * renamed HLASM Debug to HLASM Macro tracer
    * remove dupe para
    * Commenting out "todo" bits
    * gifs showing HLASM functionality
    * CA Endevor SCM
    * naming fix
    * move highligting picture
    * Using the Macro Tracer section added - REVIEW NEEDED
    * Update README.md
    final edits to readme
    * Update README.md
    * Update README.md
    adding gifs back
    * uncomment new additions
    * suggestions
    * further suggestions
    * readding
    Readding the bits removed
    * Readme update (eclipse-che4z#72) (eclipse-che4z#76)
    * Fix highlighting gif
    * New gif uploaded

commit 2da634d
Author: Michal Bali <michal.bali@broadcom.com>
Date:   Thu Jan 9 09:56:37 2020 +0100

    Add PR number to build file name (eclipse-che4z#78)

    * artifacts with PR numbers
    * asio version changed for better IP check

commit 3644009
Author: Adam Smelko <adam.smelko@broadcom.com>
Date:   Wed Jan 8 16:46:27 2020 +0100

    Performance (eclipse-che4z#73)

    * got rid of creating new parsers
    * macro reparse reusing one parser
    * fixes
    * opencode parsing reusing one parser
    * partial lookahead without semantic predicates
    * fixes
    * parsers hold ASTs again
    * concat_chain copy, opcode update
    * statement_providers directory
    * opcodes are remembered in cached statements
    * fix
    * resolved_statement_impl holds shared_ptr
    * fixes
    * fixes
    * lexer utf8-32 converter thread local, removed recursion in operand rules, uint8_t to processing_format enum types
    * deferred grammar bug + test
    * version
    * system variable count attribute fix + tests
    * confuscating
  • Loading branch information
michalbali256 committed Jan 29, 2020
1 parent a46639d commit 3cd0268
Show file tree
Hide file tree
Showing 93 changed files with 2,213 additions and 935 deletions.
20 changes: 13 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,24 @@ parallel (
}

stage('[L] Archive artifacts') {
filename = "hlasm-language-support-${version}-" + env.CHANGE_ID + ".vsix"
// Add version to file name
sh "cd ./build/alpine/bin && sudo mv vscode-hlasmplugin.vsix vscode-hlasmplugin-${version}.vsix"
sh "cd ./build/alpine/bin && sudo mv vscode-hlasmplugin.vsix ${filename}"

archiveArtifacts artifacts: 'build/*/bin/language_server,build/*/bin/*.vsix,build/clang/bin/coverage.*'
}

stage ('[L] Upload to Artifactory') {

// Create 'latest' artifact
sh 'sudo cp ./build/alpine/bin/vscode-hlasmplugin*.vsix ./build/alpine/bin/vscode-hlasmplugin-latest.vsix'

sh 'sudo cp ./build/alpine/bin/*.vsix ./build/alpine/bin/hlasm-language-support-latest.vsix'
// Obtain an Artifactory server instance, defined in Jenkins --> Manage:
server = Artifactory.server 'Test_Artifactory'
// Configure upload of artifact
def uploadSpec = """{
"files": [
{
"pattern": "./build/alpine/bin/vscode-hlasmplugin*.vsix",
"pattern": "./build/alpine/bin/hlasm-language-support*.vsix",
"target": "local-files/hlasm/alpine/"
}
]
Expand Down Expand Up @@ -194,12 +195,12 @@ parallel (


stage('[w] Archive artifacts') {

filename = "hlasm-language-support-${version}-" + env.CHANGE_ID + ".vsix"
// Add version to file name
bat "move /Y \\${BLDX86} ${env.WORKSPACE}\\HlasmPlugin\\buildx86"
//bat "cd ${env.WORKSPACE}\\HlasmPlugin\\buildx86\\bin && rename vscode-hlasmplugin.vsix vscode-hlasmplugin-${version}.vsix"
bat "move /Y \\${BLDX64} ${env.WORKSPACE}\\HlasmPlugin\\buildx64"
bat "cd ${env.WORKSPACE}\\HlasmPlugin\\buildx64\\bin && rename vscode-hlasmplugin.vsix vscode-hlasmplugin-${version}.vsix"
bat "cd ${env.WORKSPACE}\\HlasmPlugin\\buildx64\\bin && rename vscode-hlasmplugin.vsix ${filename}"

dir('HlasmPlugin/buildx64/bin') {
stash includes: "language_server.exe", name: 'lang_server_win'
Expand All @@ -214,6 +215,9 @@ Linux: {
node('Frank') {
ws("workspace/Hlasm_Plugin/${env.JOB_BASE_NAME}") {
stage('[L] Package multiplatform') {

version = readFile("./HlasmPlugin/clients/vscode-hlasmplugin/vscode-hlasmpluginVersion").trim()

def BIN_PATH = 'HlasmPlugin/clients/vscode-hlasmplugin/bin'

sh "sudo rm -rf ${BIN_PATH}"
Expand All @@ -229,7 +233,9 @@ Linux: {
sh 'wget http://czprapd-jenkins.mcl.broadcom.net:8081/artifactory/local-files/hlasm/macos/language_server-0.8.1'
sh "mkdir ${BIN_PATH}/darwin && chmod +x language_server-0.8.1 && mv language_server-0.8.1 ${BIN_PATH}/darwin/language_server"

sh 'cd HlasmPlugin/clients/vscode-hlasmplugin/ && sudo npm --unsafe-perm ci && npm run package && mv *.vsix ../../../'
filename = "hlasm-language-support-${version}-" + env.CHANGE_ID + ".vsix"

sh "cd HlasmPlugin/clients/vscode-hlasmplugin/ && sudo npm --unsafe-perm ci && npm run package && mv *.vsix ../../../${filename}"

archiveArtifacts artifacts: '*.vsix'

Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main(int argc, char** argv)
// configuration path
ws_folder = argv[1];

auto conf_path = ws_folder + "/pgm_conf.json";
auto conf_path = ws_folder + "/.hlasmplugin/pgm_conf.json";

std::ifstream in(conf_path);
if (in.fail())
Expand Down
23 changes: 13 additions & 10 deletions clients/vscode-hlasmplugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The HLASM Language Support extension parses and analyzes all parts of a HLASM pr
### Highlighting
The HLASM Language Support extension highlights statements with different colors for labels, instructions, operands, remarks and variables. Statements containing instructions that can have operands are highlighted differently to statements that do not expect operands. Code that is skipped by branching AIF, AGO or conditional assembly is not colored.

![](readme_res/highligting.png)
![](readme_res/highlighting.png)

### Autocomplete
Autocomplete is enabled for the instruction field. While typing, a list of instructions starting with the typed characters displays. Selecting an instruction from the list completes it and inserts the default operands. Variables and sequence symbols are also filled with a value from their scope.
Expand All @@ -43,23 +43,26 @@ The macro tracer functionality allows you to track the process of assembling HLA

The macro tracer is not a debugger. It cannot debug running executables, only track the compilation process.

![](readme_res/tracer.gif)
## Configuration

### Macro Tracer Configuration

To configure the macro tracer, **follow these steps**:
### Configuring the Macro Tracer

1. Open your workspace.
2. In the left sidebar, click the bug icon to open the debugging panel.
3. Click the cog icon in the top left of the screen.
A "select environment" prompt displays.
4. Enter **HLASM Macro tracer**.
Your workspace is now configured for macro tracing.
5. Open the file that you want to trace.
6. Return to the debugging panel and press **F5** to start the debugging session.

### External Macro Libraries and COPY Members
### Using the Macro Tracer

To run the macro tracer, open the file that you want to trace. Then press **F5** to open the debugging panel and start the debugging session.

When the tracer stops at a macro or COPY instruction, you can select **step into** to open the macro or COPY file, or **step over** to skip to the next line.

Breakpoints can be set before or during the debugging session.

![](readme_res/tracer.gif)

## External Macro Libraries and COPY Members
The HLASM Language Support extension looks for locally stored members when a macro or COPY instruction is evaluated. The paths of these members are specified in two configuration files in the .hlasmplugin folder of the currently open workspace. Ensure that you configure these files before using macros from separate files or the COPY instruction.

When you open a HLASM file or manually set the HLASM language for a file, you can choose to automatically create these files for the current program.
Expand Down
9 changes: 7 additions & 2 deletions clients/vscode-hlasmplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "hlasm-language-support",
"displayName": "HLASM Language Support",
"description": "Code completion, highlighting, browsing and validation for High Level Assembler.",
"version": "0.8.1",
"version": "0.8.2",
"license": "EPL-2.0",
"author": "Broadcom",
"publisher": "BroadcomMFD",
"homepage": "https://github.com/eclipse/che-che4z-lsp-for-hlasm",
Expand All @@ -15,7 +16,11 @@
"HLASM",
"LSP",
"Assembler",
"Mainframe"
"Mainframe",
"z/OS",
"zos",
"zowe",
"ibm assembler"
],
"activationEvents": [
"*"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 17 additions & 11 deletions clients/vscode-hlasmplugin/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const useTcp = false;
* your extension is activated the very first time the command is executed
*/
var highlight: ASMSemanticHighlightingFeature;
var hlasmpluginClient: vscodelc.LanguageClient;

export function activate(context: vscode.ExtensionContext) {
//debug setup
context.subscriptions.push(vscode.commands.registerCommand('extension.hlasm-plugin.getProgramName', config => {
Expand Down Expand Up @@ -87,7 +89,7 @@ export function activate(context: vscode.ExtensionContext) {
};

//client init
var hlasmpluginClient = new vscodelc.LanguageClient('Hlasmplugin Language Server', serverOptions, clientOptions);
hlasmpluginClient = new vscodelc.LanguageClient('Hlasmplugin Language Server', serverOptions, clientOptions);
//asm contribution
highlight = new ASMSemanticHighlightingFeature(hlasmpluginClient);
hlasmpluginClient.registerFeature(highlight);
Expand All @@ -97,9 +99,11 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(highlight.progress);

//first run, set the language if possible and configs
editorChanged(vscode.window.activeTextEditor);
if (vscode.window.activeTextEditor)
{
highlight.showProgress(vscode.window.activeTextEditor.document);
editorChanged(vscode.window.activeTextEditor.document);
}

// vscode/theia compatibility temporary fix
// theia uses monaco commands
Expand Down Expand Up @@ -373,6 +377,7 @@ vscode.workspace.onDidChangeTextDocument(event => {
// when document opens, show parse progress
vscode.workspace.onDidOpenTextDocument((document: vscode.TextDocument) => {
highlight.showProgress(document);
editorChanged(document);
})

vscode.workspace.onDidChangeConfiguration(event =>
Expand All @@ -398,20 +403,17 @@ const macroInstruction =new RegExp("( |\\t)+MACRO( |\\t)*");

// should the configs be checked
var configs = true;
function editorChanged(editor: vscode.TextEditor)
function editorChanged(document: vscode.TextDocument)
{
if (editor)
{
setHlasmLanguage(editor.document);
if (editor.document.languageId == 'hlasm' && vscode.workspace.workspaceFolders && configs)
checkConfigs(vscode.workspace.workspaceFolders[0].uri.fsPath);
}
if (setHlasmLanguage(document) && vscode.workspace.workspaceFolders && configs)
checkConfigs(vscode.workspace.workspaceFolders[0].uri.fsPath);
}

// when active editor changes, try to set a language for it
vscode.window.onDidChangeActiveTextEditor((editor: vscode.TextEditor) =>
{
editorChanged(editor);
if (editor)
editorChanged(editor.document);
})

function checkHlasmLanguage(text: string)
Expand Down Expand Up @@ -448,11 +450,15 @@ function checkHlasmLanguage(text: string)
}

//automatic detection function
function setHlasmLanguage(document: vscode.TextDocument) {
function setHlasmLanguage(document: vscode.TextDocument) : Boolean {
if (document.languageId == 'plaintext') {
if (checkHlasmLanguage(document.getText()))
{
vscode.languages.setTextDocumentLanguage(document, 'hlasm');
return true;
}
}
return document.languageId == 'hlasm';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion language_server/src/dap/tcp_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace hlasm_plugin::language_server;
using namespace hlasm_plugin::language_server::dap;

tcp_handler::tcp_handler(parser_library::workspace_manager& ws_mngr, request_manager& req_mngr, uint16_t dap_port)
: acceptor_(io_service_, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), dap_port)), ws_mngr_(ws_mngr), req_mngr_(req_mngr), port_(dap_port) {}
: acceptor_(io_service_, asio::ip::tcp::endpoint(asio::ip::address::from_string("127.0.0.1"), dap_port)), ws_mngr_(ws_mngr), req_mngr_(req_mngr), port_(dap_port) {}

void tcp_handler::handle_accept(const asio::error_code& error)
{
Expand Down
2 changes: 1 addition & 1 deletion language_server/src/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace language_server {
# define LOG_INFO(x) hlasm_plugin::language_server::logger::get_instance().log(x)
#else
# define LOG_ERROR(x) hlasm_plugin::language_server::logger::get_instance().log(x)
# define LOG_WARNING(x) hlasm_plugin::language_server::logger::get_instance().log(x)
# define LOG_WARNING(x)
# define LOG_INFO(x)
#endif

Expand Down
2 changes: 1 addition & 1 deletion language_server/src/lsp/feature_language_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <iostream>

namespace hlasm_plugin::language_server {
namespace hlasm_plugin::language_server::lsp {

feature_language_features::feature_language_features(parser_library::workspace_manager & ws_mngr, response_provider& response_provider) : feature(ws_mngr, response_provider)
{}
Expand Down
37 changes: 17 additions & 20 deletions language_server/src/lsp/feature_language_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,23 @@
#include "../logger.h"


namespace hlasm_plugin {
namespace language_server {

class feature_language_features : public feature
{
public:
feature_language_features(parser_library::workspace_manager & ws_mngr, response_provider& response_provider);

void virtual register_methods(std::map<std::string, method> & methods) override;
json virtual register_capabilities() override;
void virtual initialize_feature(const json & initialise_params) override;

private:
void definition(const json& id, const json & params);
void references(const json& id, const json& params);
void hover(const json& id, const json& params);
void completion(const json& id, const json& params);
};

}
namespace hlasm_plugin::language_server::lsp {
class feature_language_features : public feature
{
public:
feature_language_features(parser_library::workspace_manager & ws_mngr, response_provider& response_provider);

void virtual register_methods(std::map<std::string, method> & methods) override;
json virtual register_capabilities() override;
void virtual initialize_feature(const json & initialise_params) override;

private:
void definition(const json& id, const json & params);
void references(const json& id, const json& params);
void hover(const json& id, const json& params);
void completion(const json& id, const json& params);
};

}

#endif
Loading

0 comments on commit 3cd0268

Please sign in to comment.