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

Allow comments between variable declarations #885

Merged
merged 2 commits into from
Jul 26, 2021

Conversation

Danysan1
Copy link
Contributor

@Danysan1 Danysan1 commented Jul 24, 2021

These changes aim to fix #883 by skipping comment lines when analysing variable blocks to show reference counts.

Before

# Foo
@foo = abc
# Bar
@bar = xyz
@quz=ijk

GET https://abc.xyz?foo={{foo}}&bar={{bar}}

image

After

Immagine 2021-07-24 154707

Tests

I have no experience whatsoever with this codebase so I'm not sure wether changing this file is enough or other files need to be changed, but in my tests it worked as expected:

# Foo
@foo = abc
# Bar
@bar = xyz
@quz=ijk

GET http://urlecho.appspot.com/echo?body={{foo}}+X+{{bar}}+X+{{bar}}

image

image

const line = lines[blockStart];
if (!Selector.isFileVariableDefinitionLine(line)) {
if(Selector.isCommentLine(line)) {
Copy link
Owner

Choose a reason for hiding this comment

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

Add space between if and (

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 27caf44

@Huachao Huachao merged commit 59c6347 into Huachao:master Jul 26, 2021
@Huachao
Copy link
Owner

Huachao commented Jul 26, 2021

@Danysan1 Thanks, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reference count not shown for variables after first with comment
2 participants