Giter Site home page Giter Site logo

f4's People

Contributors

azelyaev avatar haiodo avatar hisohito avatar iinozemtsev avatar kurumar avatar rsychev avatar slimerdude avatar vspy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

f4's Issues

Default Working Directory for Run Configurations

The default Working Directory for Run Configurations recently changed from ${project_loc} to ${resource_loc} - and it's driving me insane!

I generally have a Run All Tests for a project, which naturally runs from the project root. And lots of my tests requires files, templates and such. Their paths, when referenced from Fantom code, are all relative to the project - so Run All Tests is happy. So far, all is good.

But when I run an individual test, it fails instantly because it cannot find the test files it depends on. Meaning I have to go in an change the test Run Configuration.

Because the test's run configuration doesn't exist / isn't created until I run the test, I have to run the test first, watch it fail, and then edit the run configuration. Then run the test again to see where the problem is! Argh!

So um, could the default be set back to ${project_loc}? Or maybe let be specify the default somewhere?

Interpolated URIs throw Err and disables syntax highlighting

Create a simple class:

class Example2 {
    Void main() {
        port := 69 
        uri  := `http://host:${port}`
    }
}

Close the editor. Re-open the class and you'll notice that (most) of the syntax highlighting has been disabled. While not such an issue in small classes, it's quite annoying when editing large classes.

Also, if you open up the Error Log view, you'll see extra errors logged such as:

sys::ParseErr: Invalid Uri: 'http://host:${port}'
    at fan.sys.ParseErr.make(ParseErr.java:39)
    at fan.sys.ParseErr.make(ParseErr.java:36)
    at fan.sys.ParseErr.make(ParseErr.java:23)
    at fan.sys.Uri.fromStr(Uri.java:41)
    at fan.sys.Uri.fromStr(Uri.java:26)
    at fan.f4parser.Parser.termBase(Parser.fan:1158)
    at fan.f4parser.Parser.termExpr(Parser.fan:1075)
    at fan.f4parser.Parser.unaryExpr(Parser.fan:1040)
    ...

It seems the error is caused by any invalid URI (and I've seen this many times before). http://host:${port} is deemed invalid because before interpolation, the string ${port} is not a number and hence invalid.

Errors in build.fan are not reported.

If a project's build.fan has a compilation or runtime error, nothing is reported in the editor or in the Problems view. Because build.fan is now broken, it has a nasty side effect of preventing the project from being built.

As far as the user is concerned, all of sudden, F4 silently stops compiling and doesn't tell you why.

This is a particularly nasty trap for newbies who may inadvertently forget to put a trailing slash on a resDir, or have the wrong syntax for a depends entry. For them, everything looks fine (no errors anywhere) but they can't get the project to compile.

(Starting off, I personally always had trouble getting new projects to compile in F4. I ended up with a cut and paste solution for my build.fan files!)

I explain in detail in Argh! F4 Has Stopped Compiling!.

I see this as a bigger issue than F4 launches old version of project when build fails.

PathEnv for F4 launching

  • F4 puts compiled pods to bin/lib/fan
  • Launch configuration dialog has Projects tab which allows to select which projects should be included into launch (similar to what PDE launch configuration has). For now let it be just a disabled combo with 'all fantom projects'
  • During launch, F4 spawns a process with FAN_ENV=util::PathEnv and FAN_ENV_PATH=

Can't create project from existing sources

Steps to reproduce:

First, create a project in normal way (we need sources, but without any F4 project files):

  1. Create an empty project in F4 with a single empty class (not sure this is necessary). Run 'Fantom Testing', everything works fine (it says that there are no tests).
  2. Copy the project's directory somewhere else from the workspace.
  3. In F4, delete the project (including its sources).
  4. Remove the project's pod from Fantom's lib directory
  5. In the copied directory of the project, remove files .buildpath, .classpath, .project and directory bin/. After that, 'build.fan' and fan/ directory with the empty class should only remain. So, this is now a Fantom project, but not F4's one.

Second, try to create a project from the existing sources:

  1. In F4, right-click on Fantom Explorer and choose: New -> Fantom Project
  2. Enter project name
  3. Click 'Create project at existing location'
  4. Choose the copied directory
  5. Click 'Next'

Results:

A bunch of error dialogs. 'Finish' button doesn't work, however when 'Cancel' is pressed, the project is created. But this project is broken somehow. 'fan' folder is shown as a package. 'Fantom Testing' doesn't work. Error dialogs are everywhere :)

Cannot parse Version([1,2,3]) from build.fan

A minor issue, adding it so it may be tracked.

F4 currently can only parse Version objects from build.fan if it is created with a Str ctor - Version("1.2.3"). It can not parse Version objects created with an Int array such as Version([1,2,3])

Case-insensitive completion

Currently if I type "fil" and press ctrl+space, I don't get any proposals. But I want to see File, FileBuf etc.

Field storage can cause compilation error

The following code snippet gives a compilation error in F4 but compiles fine in Fantom:

using fwt

class Example {
    Str? text

    Void main() {
        label := Label { it.text = method(this.&text) } // compilation error -> Expected ',', not '&'
    }

    Str method(Str s) { s }
}

Result Comparison dialogue box has the 'actual' and 'expected' sections the wrong way round

While the Fantom Test::verifyEq() does imply actual and expected parameter names:

Void verifyEq(Obj? a, Obj? b, Str? msg := null)

It's native Java method implementation does:

public void verifyEq(Object expected, Object actual) { verifyEq(expected, actual, null); }
public void verifyEq(Object expected, Object actual, String msg)

This is apparent when actual and expected are strings with a different number of lines:

class MyTest: Test {
    Void test1() {
        verifyEq("line1 \n line 2", "line 1")
    }
}

produces

TEST FAILED
sys::TestErr: Test failed: Expected 2 lines, actual 1 lines

Following the standard of expected being the first parameter, if I write:

class MyTest : Test {
    Void test2() {
        verifyEq("expected", "actual")
    }
}

It obviously fails, but if I double click on the failure, I get this dialogue:
expectedactual

It could be argued that Fantom should reverse its parameter list, but I don't think Brian will buy it!

Cannot call methods named 'facet()'

Trying to call the methods sys::Type#facet() or sys::Slot.facet() gives a compilation error of Expected Expression:

class Wotever {
    Void main() {
        Wotever#.facet(Deprecated#)  // compile error
    }
}

See F4 and The Word 'Facet' for current workarounds.

It does suck that the facet keyword is also a method name, but I don't think Fantom will change their core API. :\

Incorrect installation of F4 IDE

I installed F4 IDE without 'F4 Extras/Embedded fantom' and it's cause of the many exceptions in the Error Log and UI bugs (F4 explorer, Prefferences pages).
When I install 'Embedded fantom', the bugs disappeared.

As quick fix, I suggest to add dependence from the F4 IDE featire to Embedded fantom for the exclude of this situation.

Wrong line number for TODO items

Create TODO on line N of fan file and save it. Open Tasks View, it shows line N+1.
Once done, remove skipExecution tag from these tests: createNewTask, disableSearchingForTaskTags

Longhand PRE markup not honoured in Fandoc popups / hovers

When previewing Fandoc comments, pre>...<pre notation is not honoured:

class Broken {
    **   This PRE markup works.
    ** 
    ** pre>
    ** This PRE markup does not 
    ** <pre
    Void main() {}
}

When you hover over the main() method, this is rendered:
premarkup

Prioritized sorting of proposals

In case of several variants, in the top of completion list should be possible case-sensitive completions. Let me provide an example: if there are methods 'doom' and 'doOmega' and I type "doo", then completion should suggest 'doom' and 'doOmega' (the order is important), but if I type "doO" then the completion list should be ['doOmega', 'doom']. In the same way eclipse completion works for java.

F4 launches old version of project when build fails

JDT's default behavior in this case is to prompt about build errors and ask whether it is ok to launch. Since Java projects just a bunch of class files, it may cause errors in runtime, however in case of Fantom, it's all or nothing – we either have a new pod without errors, or a previously built pod. So I think a prompt message should just inform that there are build errors and launch is terminated.

'F3 - Jump To' Jumps to Wrong Type

If you have classes with the same name in multiple projects, when you click to navigate, or select and press F3, then F4 navigates to any of the classes with the same name. (And because of Murphy's law, it's usually not the class you want!)

F4 should use the using statements and / or the containing project, to resolve the type to the correct project.

Example, most of my projects have a class called ErrMsgs which contain the msgs for Errs. It's getting increasing difficult to navigate to the correct ErrMsg!

Facets on same line as declaration not recognised

Declare a slot with a facet, placing the facet on the same line as the declaration:

class Broken {
    @NoDoc Void broken() {}
}

When you close and reopen that class, note that all syntax highlighting is disabled (all text is black).

Also, that slot does not appear in any autocomplete dropdowns.

See screenshot:
operatorsameline

Losing autocompletion is more of a problem when using fields:

@Inject MyService myService

UIRunner stops displaying stack traces

Err msgs are often multi-line to show / give the user more information. When such an Err is thrown in a Test, the UIRunner errors because it can not parse every line as a stack frame. The UIRunner then does not any stack traces until F4 is re-started.

I guess essentially, the UIRunner just needs more robust stack frame parsing.

The stack trace that UI Runner throws:

sys::ArgErr: Unable to parse file name from hyperlink
    at fan.sys.ArgErr.make(ArgErr.java:32)
    at fan.sys.ArgErr.make(ArgErr.java:29)
    at fan.f4debugUi.FanHyperlink.fileName$Once(FanFileHyperlink.fan:83)
    at fan.f4debugUi.FanHyperlink.fileName(FanFileHyperlink.fan:73)
    at fan.f4testing.FanTestRunnerUI.isJavaSource(FanTestRunnerUI.fan:45)
    at fan.f4testing.FanTestRunnerUI$filterStackTrace$0.doCall(FanTestRunnerUI.fan:54)
    at fan.f4testing.FanTestRunnerUI$filterStackTrace$0.call(FanTestRunnerUI.fan:53)
    at fan.sys.Func.callBool(Func.java:51)
    at fan.sys.List.exclude(List.java:693)
    at fan.f4testing.FanTestRunnerUI.filterStackTrace(FanTestRunnerUI.fan:53)
    at org.eclipse.dltk.internal.testing.ui.TextualTrace.<init>(TextualTrace.java:35)
    at org.eclipse.dltk.internal.testing.ui.FailureTrace.updateTable(FailureTrace.java:169)
    at org.eclipse.dltk.internal.testing.ui.FailureTrace.showFailure(FailureTrace.java:150)
    at org.eclipse.dltk.internal.testing.ui.TestRunnerViewPart$7.run(TestRunnerViewPart.java:1916)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)

Default Java output folder `/fan/lib/fan/` is too deep

F4 adds an extra path of fan/lib/fan/ to whatever is specified as the Java output folder. This is unexpected behaviour and severely limits where the user can build pods.

In a typical Fantom PathEnv environment where a directory, separate to the Fantom installation, is specified for the workDir - assuming the work dir is /workDir/, your pods would need to be build in /workDir/lib/fan/.

This is not possible in F4 because should you specify /workDir/ as your java output folder, pods are built in /workDir/fan/lib/fan/.

I would recommend that the addition of the extra /fan/lib/fan/ path be scrapped. Or at the very least, be curtailed to just /lib/fan/. This would give users more control over where their pods are built.

First-class DSL support

Basically we need to check if project defines a DSL, then during compilation we should load it from file system and use during compilation. After compilation we need to somehow unload/deactivate this DSL, so that it won't be used during compilation of other projects

JS Pod Meta

F4 doesn't generate pod meta data when creating the pod's javascript

Update Readme to mention Dynamic Languages Toolkit

I followed the instructions in the readme, as in:

  • install eclipse indigo 3.7.2
  • import F4 and fantom runtime

But now I get 1000s of errors:

eclipseerrs

I assume it's probably an easy fix of enabling some PDE environment or something - but I don't know where to look... help!

Links in tooltips are inaccessible

Steps to reproduce:

  1. Write this code:
    b := Buf()
    c := b.readChar
  2. Hover mouse on 'readChar' until the tooltip is shown
  3. Click on the link to in.readChar

Result:
'Unable to load page'

Expected result:
Tooltip for 'in.readChar' is opened

Operator functions return wrong type (for autocomplete)

Write this code:

then    := DateTime.now
elapsed := DateTime.now - then

Note that the above - operator is short for invoking:

@Operator Duration minusDateTime(DateTime time)

which returns a Duration.

However F4 thinks elapsed is a DateTime. Type elapsed. + CRTL+SPACE to bring up a list of autocomplete options:
datetimedurationmixup
And you'll note the list is for DateTime and not Duration.

Can't set debug breakpoint in fcode view / code not opened as a project

If I have a project open called podA with a class called ClassA I can debug it and set breakpoints.

When I close the podA project, but use ClassA it from a new podB project I can still step into and debug ClassA but I can't set any breakpoints in it, or any class in podA.

A simple example can be demonstrated with the xml pod (which is pure Fantom code). From any project and open up the XElem class and try setting a breakpoint:

xelem

Nothing happens.

Filter private / non-accessible slots

Feature request

It would be nice if you could filter non-accessible slots from the autocomplete dropdown. So in the following example:

publicprivate

Only aPublic would be listed.

Adding "icons 1.0" as a dependency prevents compilation

Steps to recreate:

  1. Create a new Fantom project in F4 using the new project wizard.

  2. Create a new class, and introduce a compilation error. Example:

    class Bro ken 
    {
    
    }
    

    Note the problem in the Problems View.

  3. Add icons 1.0 as a dependency:

    using build
    class Build : build::BuildPod
    {
      new make()
      {
        podName = "wotever"
        summary = ""
        srcDirs = [`fan/`]
        depends = ["sys 1.0", "icons 1.0"]
      }
    }
    

    Note that the Problems View is now empty!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.