Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java plugin #557

Open
wants to merge 140 commits into
base: master
Choose a base branch
from
Open

Java plugin #557

wants to merge 140 commits into from

Conversation

Wrathan
Copy link
Contributor

@Wrathan Wrathan commented Feb 9, 2022

No description provided.

intjftw and others added 30 commits November 25, 2020 14:37
…at the parser modifies only the source of the parser.
@intjftw intjftw added Kind: Enhancement 🌟 Plugin: Java Issues related to the Java parsing and navigation service. labels Feb 9, 2022
@intjftw intjftw added this to the Release Gershwin milestone Feb 9, 2022
@intjftw
Copy link
Collaborator

intjftw commented May 15, 2022

@Wrathan Please provide a detailed user guide in doc/usage.md on how to parse Java projects.

using std::runtime_error::runtime_error;
};

class JavaParserServiceHandler : public JavaParserServiceIf {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no specific reason for putting multiple large classes into one file, please put this class into a separate header file.

"marked" : ">=0.3.6",
"marked" : "2.1.3",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a minimal version, not an exact one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially semantic versioning should be used.

Tilde Version Range (~)
The ~ operator is best explained by example: ~1.2 is equivalent to >=1.2 <2.0.0, while ~1.2.3 is equivalent to >=1.2.3 <1.3.0. As you can see it is mostly useful for projects respecting semantic versioning. A common usage would be to mark the minimum minor version you depend on, like ~1.2 (which allows anything up to, but not including, 2.0). Since in theory there should be no backwards compatibility breaks until 2.0, that works well. Another way of looking at it is that using ~ specifies a minimum version, but allows the last digit specified to go up.

Caret Version Range (^)
The ^ operator behaves very similarly, but it sticks closer to semantic versioning, and will always allow non-breaking updates. For example ^1.2.3 is equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards compatibility. For pre-1.0 versions it also acts with safety in mind and treats ^0.3 as >=0.3.0 <0.4.0 and ^0.0.3 as >=0.0.3 <0.0.4.
This is the recommended operator for maximum interoperability when writing library code.

src/dummyparser.cpp)
src/dummyparser.cpp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unnecessary.

TEST_F(JavaParserTest, simpleJavaParserTest2)
{
ASSERT_TRUE(true);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual tests should be written for the plugin, or this file is unnecessary.

TEST_F(JavaServiceTest, simpleJavaServiceTest)
{
EXPECT_EQ(7,7);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual tests should be written for the plugin, or this file is unnecessary.

target_link_libraries(javatest ${GTEST_BOTH_LIBRARIES} pthread)

# Add a test to the project to be run by ctest
add_test(allJavaTest javatest)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual tests should be written for the plugin, or this file is unnecessary.

Comment on lines +230 to +250
/*
std::vector<std::string> content;

_transaction([&, this]() {

//--- Load the file content and break it into lines ---//

model::FilePtr file = _db->query_one<model::File>(
FileQuery::id == std::stoull(range_.file));

if (!file || !file->content.load())
return;

std::istringstream s(file->content->content);
std::string line;
while (std::getline(s, line))
content.push_back(line);
});

javaQueryHandler.getSyntaxHighlight(return_, range_, content);
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code should be deleted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should stay executable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should stay executable.

@@ -1,6 +1,6 @@
#include <webserver/pluginhelper.h>

#include <service/dummyservice.h>
#include <service/javaservice.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be changed,

@@ -1,4 +1,4 @@
#include <service/dummyservice.h>
#include <service/javaservice.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be changed,

@@ -33,7 +33,7 @@ add_library(dummythrift STATIC
target_compile_options(dummythrift PUBLIC -fPIC)

add_library(dummyservice SHARED
src/dummyservice.cpp
src/javaservice.cpp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be changed,

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be renamed, instead the dummyservice should copied as the new javaservice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Enhancement 🌟 Plugin: Java Issues related to the Java parsing and navigation service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants