-
Notifications
You must be signed in to change notification settings - Fork 45
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
Noir for VSCode Extension #192
Comments
vscode command for file navigation (https://code.visualstudio.com/api/references/commands) vscode.commands.executeCommand(
"editor.action.goToLocations",
vscode.Uri.file(filepath),
new vscode.Position(linenumber, 0),
[],
"goto"
); |
- Modified `Endpoint` struct by adding a new `details` property and an initialization method - Modified `Details` struct by adding `path` and `line` properties and an initialization method - Improved default options in `options.cr` by adding a new `include_file_path` option Signed-off-by: ksg97031 <[email protected]>
Hello @hahwul ! I've added a new option to include file paths in the result output. I did this by adding a details field (a struct type) to the Endpoint to store the path and line number information. You can check out the changes in this commit: https://github.com/noir-cr/noir/tree/include-path-option 745652b I'd appreciate your feedback on this approach. Do you think it's suitable, or are there better ways to achieve this functionality? Here are examples of how the output looks with the new option now: Please give me feedback whenever you have time. No rush. |
Hiya @ksg97031 Regarding feedback, how about allowing the provision of multiple file paths instead of just one? Sometimes, an application's endpoint can be declared from multiple files, so it would be great to consider accommodating such cases by providing an array format for file paths. I think it could contribute to greater flexibility and adaptability, in my opinion. What are your thoughts on this idea? And I think the name 'Details' could potentially hold more than just 'File' and 'Line' information. So, I've made some improvements below, and I'm curious to hear your thoughts on this. e.g struct Details
include JSON::Serializable
include YAML::Serializable
@paths : Array(Path) = [] of Path
# + New details types to be added in the future..
def add_path(path : Path)
@paths << path
end
end
struct Path
include JSON::Serializable
include YAML::Serializable
property path, line
def initialize(@path : String, @line : Int32 | Nil)
end
end [
{
"headers": [],
"method": "POST",
"params": [],
"protocol": "http",
"url": "https://testapp.internal.domains/comments",
"details": {
"paths": [
{"path":"/source/123.java", "line": 35},
{"path":"/source/123.java", "line": 124},
{"path":"/route/route.java", "line": 12},
]
}
}
] |
@ksg97031
I also think it might be a good idea to consolidate plain and JSON outputs into a single flag. For instance, when using the |
@ksg97031 |
- Modified various analyzer classes to include a `Details` object in each `Endpoint` for better endpoint details tracking. - Updated the output builder to properly display multiple file paths and line numbers in the output. Signed-off-by: ksg97031 <[email protected]>
- Refactored multiple analyzer files to include the `Details` object for storing path and line number information - Updated the `Endpoint` struct to include a new method `set_details` and added new structs `Details` and `PathInfo` Signed-off-by: ksg97031 <[email protected]>
- Refactored multiple analyzer files to include the `Details` object for storing path and line number information Signed-off-by: ksg97031 <[email protected]>
- Refactored multiple analyzer files to include the `Details` object for storing path and line number information Signed-off-by: ksg97031 <[email protected]>
No description provided.
The text was updated successfully, but these errors were encountered: