eclipse-che4z / che-che4z-lsp-for-cobol Goto Github PK
View Code? Open in Web Editor NEWCOBOL Language Support provides autocomplete, highlighting and diagnostics for COBOL code and copybooks
License: Other
COBOL Language Support provides autocomplete, highlighting and diagnostics for COBOL code and copybooks
License: Other
Michelle wants to have a syntax check for the COBOL compiler directives that are used in her code.
The current state of this capability is that now there is a CobolUnsupportedFeaturesIgnorerImpl
that removes the lines with the compiler directives. Also, there is special logic in the preprocessor to recognize them. It means that the logic of CobolUnsupportedFeaturesIgnorerImpl
should be changed in order to prepare the compiler directives to be processed in the preprocessor.
As a Michelle, I would like to use autocomplete feature so I can see all my paragraphs
Provide a new delegated implementation of AbstractCompletion
Enhance and improve the copybooks support - TBD
Description:
Paragraph usage (i.e. in a PERFORM statement) is not recognized if the paragraph name is on the next line that is marked as a continuation line.
Steps to reproduce:
000000 PROCEDURE DIVISION.
000001 PERFORM
000002- PARAGRAPH-NAME
000003 PARAGRAPH-NAME.
Expected behavior:
Two usages are shown
Actual behavior:
Only the second usage is shown
Description:
As a software engineer, I would like to differentiate between areas in COBOL as fixed format implies so I can validate more input and show correct diagnostic messages.
Acceptance criteria:
Definition of Done:
This US will be completed once all dependencies are completed and use cases are implemented.
Example of use case:
This modification is required in order to avoid the problem we got on Che instance where instead of the source attribute is displayed to the user some internal object reference, as shown below:
Here the reference from the LSP protocol specification: https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#diagnostic
Update the client-server communication and update readme and contributing
Provide JaCoCo maven configuration to sonar-cloud in jenkins file.
As a software engineer, I would like to have a dependency injection support so I can build the dependencies between the components in an easy way.
TPSR is verified
DI is configured for the service and core parts
DI is applied to the current dependencies
The solution is tested on all the platforms
Licence information is updated
As a software engineer, I would like to have a lightweight DI framework, not some enterprise-level one. Have a look at Guice.
when java is not installed then an error has to be shown to the user
please mark as enhancement
Michelle wants to have all the copybook names that are used in the current COBOL file, as well as those that present in the workspace to be suggested if autocomplete is invoked.
As a software engineer, I would like to have my code covered with tests.
lsp-core-domain
module is more 80%. The current value is 0%Problem messages contain a string "_generated_diagnostic_collection_name#" that is longer than the error message itself
Description:
Update the plugins properties (publisherID, plugins name, version) for LSP for COBOL
Please also check value for the author and description
Acceptance criteria:
publisherID = BroadcomMFD
name = lsp-for-cobol
displayName = LSP for Cobol
version = 0.8.0
categopry="Programming Languages"
Rally ID: US608918
Description:
Michelle, the open-source contributor, wants to run an automatic regression test suite from Eclipse infrastructure so that she improve her code testing.
Acceptance criteria:
Definition of Done
As a software engineer, I would like to have semantic analysis based on referred copybooks so I can perform the analysis more accurately having the complete semantic context.
As an example: Create a copybook file that contains a definition of a variable. In the main/root COBOL file, import/copy the copybook and use the variable, defined in the copybook, for a statement in PROCEDURE DIVISION.
https://about.sourcegraph.com/blog/part-2-how-sourcegraph-scales-with-the-language-server-protocol
Trying to match Java version by parsing 'java -version' output should respect other JRE/JDK implementations. This would fail to match Java version if OpenJDK is used.
https://github.com/eclipse/che-che4z-lsp-for-cobol/blob/09830e49a941c0575b79416163418f5c257c3184/clients/cobol-lsp-vscode-extension/src/extension.ts#L69
Example output:
# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (IcedTea 3.13.0) (Alpine 8.222.10-r0)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
As a software engineer, I would like to have my code aligned to the code excellence standards so I can easily maintain code and introduce new features
Interface names should not contain any markers (like "I" at the start) because it is not necessary for clients to know that type is an interface. Implementations should contain the interface name and a word that describes the purpose of this class, or "Impl" at the end if it is planned to have only one implementation at the moment (only if you cannot imagine something more descriptive).
For example, CobolTextDocumentService implements TextDocumentService.
If some class implements some pattern (i.e Singleton, Strategy, etc.) then it should be specified in the name.
For example, CobolErrorStrategy.
Class names should not be too generic or contain some "er"-words - Manager, Server, etc. unless it is some specification or domain requirement.
For example, MessageManager is bad, Messages is good. If you have a problem with naming, maybe you should split the class, to let every part have only one purpose or abstraction level.
Methods should contain only one responsibility and one abstraction level. Also, the names should be descriptive.
Each public method should have a Javadoc comment that describes the parameters and the results (i.e. does it accept or return null if it may be important, that checks for the parameters does it apply). Also, if there is some complicated logic, it should be described in the comment. The best practice would be also to add code examples to the class Javadoc comment.
There should be no author section at the comments.
Unit tests that are use cases should contain the description and purpose of the case.
You should avoid in-code comments unless it is necessary.
Try to use as fewer method parameters as you can. The best practice is to make the method name describing why the parameters are necessary, for example - getUserBy(long id).
Avoid (until is not strictly necessary) to pass null as parameter
Always extract complicated logical sentences.
Use Lombok where it is possible to reduce boilerplate code.
Update readme file using Cobol Language Support instead of LSP for COBOL extension
Description:
Provide a rotating file logging that will store files in the "server" folder not more than one month and limit the size of one file to 10MB and total to 1GB. The default log level should be set as "ERROR".
The enhancement should work with the existing Logback configuration.
As a software engineer, I would like to have a common file engine that would be available from service and core parts and store all the files so the application will have one entry point to manage the Cobol files
Michelle wants her analysis to be automatically run if new copybooks appear.
It is written in the working storage area like this:
01 Var1
03 Var2
...
03 Var25
SKIP2
01 Var26
05 Var 27
There is a requirement to fulfill the code coverage, in order to do so we need to call some methods of the visitor. As the visitor uses the parser context we need to mock it using Mockito.
Description:
As a part of quality assurance, I would like to have all the exceptions appearing while the syntax and semantic analysis to be caught and logged.
Acceptance Criteria:
Technical Details:
We use CompletableFuture
framework to run the analyzing tasks asynchronously. It also means that all the uncaught exceptions will be hidden. To prevent it, we may use
CompletableFuture.whenComplete((res, ex) -> ex.printStackTrace());
to log the exception stack.
The best methods to apply it are MyTextDocumentService#analyzeDocumentFirstTime()
and MyTextDocumentService#analyzeChanges()
.
As a software engineer, I would like to have my code covered with tests.
lsp-core-cobol-parser
module is more 80%. The current value is 63.5%Use SonarCloud to scan source code and perform code smells within the Jenkins pipeline
All instances of COBOL should be uppercase.
Description:
There are some edge cases not covered in MyDocumentModel#retrieveToken(Position position, Line route) method. Please, add some checks before calling the substring. Also, update the test.
Steps to reproduce:
TBD
As a software engineer, I would like to have my code of good quality. Fix the code smell found by SonarCloud in order to raise the maintainability and prevent issues.
All the confirmed code smells are fixed.
Description: Modify the package json in order to include repository informations
Acceptance criteria: Apply the required modifications on the specific fields:
Michelle wants to get a Syntax highlighting option also for variables and paragraphs so that she can see the usage of those elements immediately with a background made by the client.
LSP marks ++INCLUDE as a syntax error.
Description:
As a software engineer, I want to have all the components that work in the multithread environment to be thread-safe. We may have a ConcurrentModificationException
on Analysis class if several threads would run it simultaneously.
Acceptance Criteria:
com.ca.lsp.cobol.service.delegates.validations.Analysis
is thread-safeA Readme file will show short gifs with syntax awareness examples.
There is a usage of a deprecated method StringUtils#getLevenshteinDistance()
in CobolVisitor
. It is recommended to replace it with LevensteinDistance of Apache commons-text.
TPSR verification is required.
Description:
There is an error message appearing in a log console while running the extension. See below for the detailed message.
Steps to reproduce:
Expected Behavior:
No error message
Actual Behavior:
An error message appears:
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
If a variable type changed at the compile/run time because of the poor definition of level data and the group item is not followed by a nested variable (a child) then our LSP should apply a check in order to see if the PIC value is defined.
In the example above we should see a syntax error on the VAR3 definition.
Description:
In case if there are several COPY statements in a row with the same name, ArrayIndexOfBoundsException is thrown. Code example:
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST1.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 PARENT. COPY STRUCT.
COPY Struct.
The content of "STRUCT":
02 PARENT2.
03 CHILD1 PIC 9 VALUE IS '0'.
03 CHILD2 PIC 9 VALUE IS '1'.
03 CHILD3 PIC 9 VALUE IS '2'.
Error message:
java.util.concurrent.CompletionException: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1643)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:422)
at java.util.ArrayList.remove(ArrayList.java:499)
at com.ca.lsp.core.cobol.semantics.CobolVariableContext.buildVariableStructure(CobolVariableContext.java:83)
at com.ca.lsp.core.cobol.semantics.CobolVariableContext.merge(CobolVariableContext.java:73)
at com.ca.lsp.core.cobol.semantics.SemanticContext.merge(SemanticContext.java:33)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at com.ca.lsp.core.cobol.preprocessor.sub.document.impl.CobolSemanticParserImpl.processCopybooks(CobolSemanticParserImpl.java:79)
at com.ca.lsp.core.cobol.preprocessor.sub.document.impl.CobolSemanticParserImpl.processLines(CobolSemanticParserImpl.java:65)
at com.ca.lsp.core.cobol.preprocessor.impl.CobolPreprocessorImpl.parseDocument(CobolPreprocessorImpl.java:89)
at com.ca.lsp.core.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:73)
at com.ca.lsp.core.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:54)
at com.ca.lsp.core.cobol.engine.CobolLanguageEngine.run(CobolLanguageEngine.java:47)
at com.ca.lsp.cobol.service.delegates.validations.CobolLanguageEngineFacade.analyze(CobolLanguageEngineFacade.java:56)
at com.ca.lsp.cobol.service.delegates.validations.Analysis.run(Analysis.java:48)
at com.ca.lsp.cobol.service.MyTextDocumentService.lambda$analyzeDocumentFirstTime$11(MyTextDocumentService.java:186)
at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640)
... 6 more
I have a variable that is assigned as PIC 9(02).
It would be great if the extension
As a software engineer, I would like to have my code covered with tests.
lsp-service-cobol
is more 80%. The current value is 81.0%Michelle wants to have "Find all references" and "Go to Definition" support for copybooks.
Create Changelog file for the project
There is a deprecated maven parameter used in lsp-service-cobol/pom.xml
. See the warning message below:
The parameter forkMode is deprecated since version 2.14. Use forkCount and reuseForks instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.