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

Fix Msbuild, fix project/item templates, improve intellisense. #286

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

Commits on Jul 1, 2017

  1. Configuration menu
    Copy the full SHA
    7653534 View commit details
    Browse the repository at this point in the history
  2. Not all cargo build JSON lines are messages. Add some null checks ins…

    …tead of crashing on non-messages.
    
    This fixes a crash for me on cargo 0.19.0 (28d1d60d4 2017-05-16), example output follows:
    
    I:\home\projects\test\testrust>cargo build --message-format=json 2>NUL
    {"features":["default","use_std"],"filenames":["I:\\home\\projects\\test\\testrust\\target\\debug\\deps\\liblibc-f4ccf2fa58092d85.rlib"],"fresh":true,"package_id":"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)","profile":{"debug_assertions":true,"debuginfo":2,"opt_level":"0","overflow_checks":true,"test":false},"reason":"compiler-artifact","target":{"crate_types":["lib"],"kind":["lib"],"name":"libc","src_path":"C:\\Users\\MikeR\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\libc-0.2.24\\src\\lib.rs"}}
    {"features":[],"filenames":["I:\\home\\projects\\test\\testrust\\target\\debug\\deps\\librand-76456d761c2cb637.rlib"],"fresh":true,"package_id":"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)","profile":{"debug_assertions":true,"debuginfo":2,"opt_level":"0","overflow_checks":true,"test":false},"reason":"compiler-artifact","target":{"crate_types":["lib"],"kind":["lib"],"name":"rand","src_path":"C:\\Users\\MikeR\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rand-0.3.15\\src\\lib.rs"}}
    {"message":{"children":[],"code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```ignore\nuse foo::bar;\nbar();\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","message":"cannot find value `guess_no2` in this scope","rendered":null,"spans":[{"byte_end":604,"byte_start":595,"column_end":23,"column_start":14,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":"did you mean `guess_no`?","line_end":24,"line_start":24,"suggested_replacement":null,"text":[{"highlight_end":23,"highlight_start":14,"text":"\t\t\t\t\tif      guess_no2 < target { println!(\"Guess too low\"); }"}]}]},"package_id":"testrust 0.1.0 (path+file:///I:/home/projects/test/testrust)","reason":"compiler-message","target":{"crate_types":["bin"],"kind":["bin"],"name":"testrust","src_path":"I:\\home\\projects\\test\\testrust\\src\\main.rs"}}
    {"message":{"children":[],"code":null,"level":"error","message":"aborting due to previous error","rendered":null,"spans":[]},"package_id":"testrust 0.1.0 (path+file:///I:/home/projects/test/testrust)","reason":"compiler-message","target":{"crate_types":["bin"],"kind":["bin"],"name":"testrust","src_path":"I:\\home\\projects\\test\\testrust\\src\\main.rs"}}
    MaulingMonkey committed Jul 1, 2017
    Configuration menu
    Copy the full SHA
    6323a84 View commit details
    Browse the repository at this point in the history
  3. Project and item templates were only included in Debug vsix builds. A…

    …dd them to Release vsix builds.
    MaulingMonkey committed Jul 1, 2017
    Configuration menu
    Copy the full SHA
    e070ed2 View commit details
    Browse the repository at this point in the history
  4. Add original source path to racer command line for better inrellisense.

    I've observed that in practice this allows the completion of basic static methods, such as "rand::thread_rng().gen_range(1,11);"
    MaulingMonkey committed Jul 1, 2017
    Configuration menu
    Copy the full SHA
    7649846 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dd67195 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2017

  1. Configuration menu
    Copy the full SHA
    9675cdd View commit details
    Browse the repository at this point in the history
  2. Move RustGoToDefinitionCommandHandler's temp files out of the project…

    … directory.
    
    This was presumably originally done to improve "racer find-definition"'s results.
    However, it takes an optional [substitute_file] parameter we can use instead:
        racer find-definition <linenum> <charnum> <path> [substitute_file]
    
    This change eliminates the following churn in the "Visual Rust" output tab:
        Apply change: File created: I:\home\projects\test\testrust\src\main.rs~RFa2df0b.TMP
        Apply change: File created: I:\home\projects\test\testrust\src\main.rs~RFa2df0b.TMP
        Failed to apply change 'File created: I:\home\projects\test\testrust\src\main.rs~RFa2df0b.TMP':System.ComponentModel.Win32Exception (0x80004005): Access is denied
           at VisualRust.ProjectSystem.FileSystem.ToShortPath(String path)
           at ...
        Apply recovery change: Directory created: I:\home\projects\test\testrust\
    MaulingMonkey committed Jul 3, 2017
    Configuration menu
    Copy the full SHA
    4f2402c View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2017

  1. Don't ctor *and* member inject IRustLexer. Also fix CompositionExcept…

    …ion s caused by spurious readonly.
    MaulingMonkey committed Jul 4, 2017
    Configuration menu
    Copy the full SHA
    38b5e9d View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2017

  1. Fix ArgumentException when displaying errors from macros.

    Errors in macro expansions sometimes don't have real "file_name"s at every expansion level.
    This simply attempts to recursively expand until we can combine the paths sanely.
    Other alternatives might include comparing against target src_path, or looking for an ".rs" extension.
    MaulingMonkey committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    f29c5ad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8a1ae0 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2017

  1. Separate racer match parsing out into it's own file, RacerMatch.cs.

    - Will make parsing available to future "signature help" popup hints.
    - Handle unescaping of rust strings, semicolon escapes, etc.
    - Document the heck out of members, complete with examples.
    MaulingMonkey committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    3e499d0 View commit details
    Browse the repository at this point in the history
  2. Intellisense and goto def/help improvements, overhaul tokenization.

    User Interface changes:
    - F1 Help can now look up types, primitives.
    - Find definition now fully delegates to 'racer find-defition'.
    - Rust completions no longer triggered when definining new identifiers.
    
    Tokenization changes:
    - Replaced misused/understood "GetTokensAtPosition" with "GetLineTokensUpTo" and "GetTokensAt".
    - Documented and added explicit examples to help head off any confusion.
    - Added tracing of RustCompletionCommandHandler to see impacts.
    
    Fixed problems / rationale:
    - Single character tokens could previously never be "currentToken".
    - "currentToken" was usually null.
    - "leftToken" would often be the *last* token when typing in the *middle* of a line.
    
    Possible future paths:
    - Some kind of multiline token fetcher that fetches enough tokens for us to work with, without tokenizing the entire document.
    - Full blown AST?
    MaulingMonkey committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    7b9f314 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2017

  1. Configuration menu
    Copy the full SHA
    5251e84 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2017

  1. Reduce completions to summary paragraphs (via RacerMatch accessors.)

    Previously, all documentation for an identifier was displayed.  This
    included "# Examples" sections and lots of potentially long and rambling
    documentation.
    
    Rustdoc conventions suggest an initial "summary line", which would be
    a good defacto standard to display.  In practice, the initial few
    paragraphs before the first header section also seem worth displaying,
    but that's perhaps more my personal taste.  I've provided accessors for
    getting at "Plain" versions of both.
    
    Refactoring:
    - RustCompletionSource:  Move regexps to RacerMatch.
    - RacerMatch:  Expose Plain{Documentation,SummaryLine,SummaryParagraphs}
    MaulingMonkey committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    96c62f8 View commit details
    Browse the repository at this point in the history
  2. (Re)trigger intellisense after structural '.' or '::'.

    Floating point numbers aren't considered STRUCTURAL, so this doesn't
    incorrectly trigger for "12." and similar expressions.
    MaulingMonkey committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    830f79f View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2017

  1. README.md: Document the use of submodules and lfs.

    The default errors that e.g. Visual Studio gives when failing to do
    either of these are unhelpful at best, downright confusing at worst.
    As I'm apparently not alone in overlooking these steps, they seem worth
    documenting.
    
    Ref: PistonDevelopers#294
         "Multiple Issues opening and building the solution in VS2017"
    MaulingMonkey committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    8173634 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2017

  1. Configuration menu
    Copy the full SHA
    9a5227f View commit details
    Browse the repository at this point in the history
  2. Rewrite solution to cull bad configs/platforms, add single-VS options.

    Also build Debug platforms for completeness.
    
    Configurations:
      - Removed "Debug.Lab" and "Release.Lab" - these seem unnecessary.
      - Always build 'everything', instead of a weird hodge podge of missing
        projects for any given configuration.
      - Always build project configurations by the same name.
    
    Platforms:
      - "Mixed Platforms" replaced with "All VS", which builds everything always.
      - New "VS2015 Only" builds everything but VS2017-specific projects.
      - New "VS2017 Only" builds everything but VS2015-specific projects.
      - "x86", "x64", and "Any CPU" are all removed.  We always want to build
        a mixture of "Any CPU" (most projects) and "x86" (setup projects.)
    
    Closes PistonDevelopers#295
           "Clean up solution config/platform matrix."
    MaulingMonkey committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    cf71f9a View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2017

  1. Fix vsix paths to LICENSE.txt.

    .debug.vsixmanifest already referenced LICENSE.txt
    
    Ref: PistonDevelopers#301
        "Could not uninstall VSIX - looking for LICENSE.txt"
    MaulingMonkey committed Jul 29, 2017
    Configuration menu
    Copy the full SHA
    0239104 View commit details
    Browse the repository at this point in the history