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

Support "constructor" syntax #69

Merged
merged 9 commits into from Apr 19, 2018

Conversation

Projects
None yet
4 participants
@ice1000
Contributor

ice1000 commented Apr 18, 2018

According to #68

  • Fixed compilation errors under IDEA 2018.1
  • Applied some IntelliJ IDEA suggestions
  • Use Kotlin 1.2.31 which generates better optimized bytecode
  • Support "constructor" syntax but didn't provide full support like completions or stubs
  • Added corresponding parser unit test

ice1000 added some commits Apr 18, 2018

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Apr 18, 2018

Why doesn't this compile? I don't think changing to 2018.1 will cause the strange compilation error shown in the CI log.

I can compile it and run tests on my laptop.

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Apr 18, 2018

All failed tests are under SolidityCompleteOfficialFailingParsingTest, which looks like they're failing by design.

@SerCeMan

Thanks for this. I'll take one and will merge it today 👍

if (ijEvent == null) {
return true
}
val ijEvent = events.firstOrNull() ?: return true

This comment has been minimized.

@SerCeMan

SerCeMan Apr 19, 2018

Member

I intentionally try to avoid nullable ?: return smth idiom because it often hides the control flow in debugging, e.g. it's often unclear at which moment the method gets returned.

This comment has been minimized.

@ice1000

ice1000 Apr 19, 2018

Contributor

Ok, reverted.

@SerCeMan

This comment has been minimized.

Member

SerCeMan commented Apr 19, 2018

Oh, just noticed messages about the errors, I'll try to check why

@SerCeMan

This comment has been minimized.

Member

SerCeMan commented Apr 19, 2018

which looks like they're failing by design.

The generated AST has probably changed

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Apr 19, 2018

The generated AST has probably changed

Have you mentioned my change in the .bnf file? I don't think simply adding an alternative branch to ContractPart will affect other AST structures..

@SerCeMan

This comment has been minimized.

Member

SerCeMan commented Apr 19, 2018

Have you mentioned my change in the

I haven't tried to run these tests locally yet, but you can try to regenerate lexer/parser (there is a run configuration for this), and run the test locally to see the difference. If there is no difference then I can't say off the top of my head what's wrong, but I'll take a look.

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Apr 19, 2018

@SerCeMan Fixed test cases. It's actually the difference of the error message.

@codecov-io

This comment has been minimized.

codecov-io commented Apr 19, 2018

Codecov Report

Merging #69 into master will decrease coverage by 0.05%.
The diff coverage is 87.27%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #69      +/-   ##
============================================
- Coverage     47.82%   47.77%   -0.06%     
  Complexity      116      116              
============================================
  Files            78       78              
  Lines          2022     2018       -4     
  Branches        366      363       -3     
============================================
- Hits            967      964       -3     
- Misses          933      935       +2     
+ Partials        122      119       -3
Impacted Files Coverage Δ Complexity Δ
src/main/kotlin/me/serce/solidity/ide/structure.kt 0% <ø> (ø) 0 <0> (ø) ⬇️
src/main/kotlin/me/serce/solidity/lang/language.kt 69.23% <ø> (-10.77%) 0 <0> (ø)
...lin/me/serce/solidity/ide/run/SolidityRunConfig.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
.../serce/solidity/ide/colors/SolColorSettingsPage.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
...e/solidity/ide/run/compile/SolcMessageProcessor.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
...c/main/kotlin/me/serce/solidity/ide/highlighter.kt 98% <100%> (-0.04%) 0 <0> (ø)
...olidity/ide/refactoring/RenameContractProcessor.kt 80% <100%> (+40%) 5 <0> (ø) ⬇️
...dity/ide/refactoring/RenameConstructorProcessor.kt 100% <100%> (+33.33%) 5 <1> (ø) ⬇️
...ang/resolve/ref/SolUserDefinedTypeNameReference.kt 80% <0%> (-4%) 3% <0%> (ø)
...in/kotlin/me/serce/solidity/lang/resolve/engine.kt 84.78% <0%> (-0.73%) 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 632bb6e...2f7f443. Read the comment docs.

@SerCeMan

Looks great to me!

@SerCeMan SerCeMan merged commit 19f1a25 into intellij-solidity:master Apr 19, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Kipriz

This comment has been minimized.

Kipriz commented Apr 23, 2018

When are you planning to make a release with this PR?

@SerCeMan

This comment has been minimized.

Member

SerCeMan commented Apr 23, 2018

Hey, @Kipriz! Probably this week, there are some issues/features that require additional testing, in the meantime, you can build a version from master using the instructions in README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment