Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit ee1c17a

Browse files
author
Sarah Marshall
committed
Squashed commit of the following:
commit 0e4865cc3784391d18e7dd814d736cef98c9dd5b Merge: 3121348 f4bf991 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sun Jul 21 03:42:15 2019 +0000 Merged PR 1745: Add documentation, signature, and containing namespace to completion items This PR depends on !1744. This works best in Visual Studio Code. It only partially works in Visual Studio (only the "detail" property, which just has the containing namespace, is shown). (I still need to try updating the VS language server packages to see if that fixes it.) commit f4bf991fb70a02ca44d2ef29c822b1f3553f17bc Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 20 20:39:33 2019 -0700 Use QsNullable correctly in TryGetDocumentation commit 36f98b537e9e8c5c735db33b6133885e71481ae0 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 20 20:31:24 2019 -0700 Manually add newlines after trimming signature and documentation commit b2a19df6d418ef503ead00e98ed315716cc2c44b Merge: e255e77 3121348 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 20 20:20:09 2019 -0700 Merge remote-tracking branch 'origin/features/languageServer' into marshallsa/completionDetail commit 312134822f1323f9c21d853e03b2ef804f25eef3 Merge: 757c8e6 098a2d9 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sun Jul 21 03:17:29 2019 +0000 Merged PR 1744: Show completions for namespaces and qualified names Other changes: 1. Added a 50ms delay to completion to fix some issues with the "." trigger character not working sometimes (I only had the issues in VS Code, not VS for some reason). Signature help uses a 100ms delay, but this was too noticeable for completion IMO. 2. Added two new public members to NamespaceManager commit 098a2d9b90066e62a33f532852da23af0bcf274b Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 20 20:09:45 2019 -0700 Add read locks to new NamespaceManager methods commit c8dd8bfba5ac86c6392c0d22e0b70d10e2591ee1 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 20 20:04:27 2019 -0700 Make TryResolveQualifier private and add a new member that returns the NS name commit 9c072bff2ba7843658d968dbee9804e7d822528c Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 20 19:24:32 2019 -0700 Return namespace names instead of namespace objects commit e255e772318f70d0bbe46e96a472161aeb103933 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 14:01:10 2019 -0700 Be more careful with nulls in CompletionItemData commit 88dd39250ec2d651d086a1fb4f6431c4f0ce6a66 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 11:41:21 2019 -0700 Wrap Completions/ResolveCompletion in QsCompilerError.RaiseOnFailure commit b6dad610b3c64a4042fc8c2e9b84068310c9de1d Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 11:33:28 2019 -0700 Update doc comment for ResolveCompletion commit 23b132bb847bebbe5d446fd23e7e748427a2e938 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 11:02:26 2019 -0700 Add more null checks to ResolveCompletion commit 4583824e824fef6a087c54acaab9e9cd9070b057 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 10:50:25 2019 -0700 Fill in all arguments to TryGetCallable/TryGetType commit 929d5ec554d314814f2f81fd0c1361e9138f7578 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 10:22:08 2019 -0700 Move null check earlier in TryGetDocumentation commit 9b1e444164498d2642feb51f8df49c3a5bf81003 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 09:59:17 2019 -0700 Remove trailing dot from parent NS in NS completions commit dddb4e78e97d275ee49bc705dffbef7a77532d5b Merge: cff38ae 20e8a3d Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 17 09:53:10 2019 -0700 Merge branch 'marshallsa/completionQualified' into marshallsa/completionDetail commit 20e8a3dc11b0a65ceaf75a0d1d9c3c4be7e491d7 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 19:08:26 2019 -0700 Get all namespaces directly instead of from list of callables/types commit d88aa461a7fce0b70d1b1930fc3e64265c13e5d2 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 16:09:50 2019 -0700 Add read lock to ResolveType commit 65bba33366a0a98c8a159632e0b374a3ad185652 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 15:59:05 2019 -0700 Fix indentation in TryResolveQualifier commit 0e5289780685983af3c66cadc375e17c504db0bb Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 15:49:34 2019 -0700 Use QsNullable instead of option for TryResolveQualifier commit 48ea240792137bdf7f87c9a2502bc94385a3bbf2 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 15:27:43 2019 -0700 Rename GetUnqualifiedNamespaces to GetOpenNamespaces commit dec6147f5201c1665a4b03ae6fa3afa9ba8f5c65 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 15:14:23 2019 -0700 Return null instead of empty enumerator if parameter is null commit e8caf9d5758c6c3b2d5d1a79cebfd70650bd96ef Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 16 12:43:38 2019 -0700 Use better wording in GetGlobalNamespacesCompletions commit cff38aeb34aeba481771b50512966e54dd7bf7db Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 15 15:59:57 2019 -0700 Show original namespace as detail for aliases commit 54b9614b3f5d256a56469b8fdd7efbfe58fa1afc Merge: a767db8 fb0dc09 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 15 15:48:23 2019 -0700 Merge branch 'marshallsa/completionQualified' into marshallsa/completionDetail commit fb0dc092222b52f69c92c31268f4bfd6c50e2d85 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 15 15:05:10 2019 -0700 Use TryResolveQualifier commit 4580da27e7ebbe527d27a13924af1dcaf7359e46 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 15 11:45:14 2019 -0700 Show completions for symbols inside a namespace alias commit 57929006e6bb5f0318dc30493b3c3d36f186d475 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 15 11:16:42 2019 -0700 Show completions for namespace aliases commit 5a449121446e8b7282bd4a47ec6b81978f227c26 Merge: 3faf90c 757c8e6 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 15 09:43:56 2019 -0700 Merge remote-tracking branch 'origin/features/languageServer' into marshallsa/completionQualified commit 757c8e665e3da0c56a2e87c1ba06e6ce3b76312a Merge: 4ff1ef1 697dd20 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 13 18:35:56 2019 +0000 Merged PR 1738: Disable completion after "as" in "open ... as ..." directive The short name/alias after "as" is a new symbol declaration, so I think completions should be disabled for it. commit 3faf90ce68a058157c9b90236d8a1d9a2cfb5d0d Merge: def4ef7 4ff1ef1 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 12 23:40:05 2019 -0700 Merge remote-tracking branch 'origin/features/languageServer' into marshallsa/completionQualified commit 697dd203d3abcbb3e5fa9e05d8fa30abe11d228c Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 12 23:11:29 2019 -0700 Disable completion after "as" in "open ... as ..." directive commit 4ff1ef1b184a880760502c1b585ad4272df156dd Merge: 6acd5ca 339668d Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jul 13 01:33:59 2019 +0000 Merged PR 1732: Add completion for callables, types and keywords I decided to show completions for all keywords instead of just type keywords since it was easier for now. :) And it looks like completions for C# in Visual Studio show the same icon for all keywords, including type keywords, so there is no need to separate the different kinds of keywords yet. When completion becomes more context-aware I will probably have to start grouping the keywords into different kinds. With this PR, I think every possible identifier except namespaces should show up as a completion now. commit 339668d07c3eaaf65bcf09ca172c88373a2330fe Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 12 18:23:36 2019 -0700 Don't show completions from namespaces opened with a short name commit 7b4d450aebb67bcf68d3340a6384a2ef6f36d5c2 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 12 17:56:08 2019 -0700 Add TODO for filtering completions based on context commit a767db8f88fa75dd328bc1bdac26754a3c13404c Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 12 17:29:59 2019 -0700 Add a resolve provider for documentation commit 8201ab9c0ab988f99d52be85428de8642138844e Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jul 11 16:41:42 2019 -0700 Choose markup kind automatically commit 29d65dd6aeb4214942d1f1548336d324aa635bdb Merge: 233699d 6acd5ca Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jul 11 14:20:50 2019 -0700 Merge remote-tracking branch 'origin/features/languageServer' into marshallsa/completionDetail commit d3170b7e281223d8c8d38c25254818adfea3d70e Merge: f2f7b57 6acd5ca Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jul 11 11:22:04 2019 -0700 Merge remote-tracking branch 'origin/features/languageServer' into marshallsa/completionGlobals commit 233699d4d85d6b714c60dd4000aebfcfe9270754 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 10 16:30:45 2019 -0700 Show signature and documentation for callables and types commit 6acd5cae6d72498a5a94e675744f2b4db72e6a16 Merge: 0b8b2a5 013536f Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 10 16:30:06 2019 -0700 Merge branch 'oss' into features/languageServer commit 013536ff553ba11c902f8d8a86e1ce400965ac9f Merge: b23d509 0e20c73 Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 10 15:43:13 2019 -0700 Merge branch 'oss' of https://github.com/microsoft/qsharp-compiler into oss commit 0e20c73e8564391e241004bfe2940fed9a96dad2 Merge: 4a3c8ae 727788d Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Wed Jul 10 15:39:46 2019 -0700 Merge pull request #22 from microsoft/anpaz/telemetry Workaround for using multiple compiler constants from command line with F# commit cb949bbbde2d57b464c7191c62504bb33cc794a1 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 10 14:35:59 2019 -0700 Show namespace each callable/type belongs to commit b23d50906045bf01fde412223772e6734383aa85 Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 10 08:20:09 2019 -0700 keeping package licence info in the nuspec file commit 727788dce0fd7f584afe5987f5f9c983d22d45a6 Merge: e2473e1 4a3c8ae Author: Andres Paz <anpaz@microsoft.com> Date: Tue Jul 9 23:56:03 2019 -0700 Merge remote-tracking branch 'origin/oss' into anpaz/telemetry commit e2473e146a4ba4902c01640698d1ee1bd516ec25 Author: Andres Paz <anpaz@microsoft.com> Date: Tue Jul 9 23:52:38 2019 -0700 Support to run scripts from outside build folder. commit b93983d35b5d7d87c9a7dd91bae56bad84142221 Author: Andres Paz <anpaz@microsoft.com> Date: Tue Jul 9 23:51:51 2019 -0700 Workaround for using multiple compiler constants from command line in F# projects. commit 4a3c8ae46c1623e80921aaeac366bd6019861606 Merge: 39b9ad9 7dbdb21 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 23:04:32 2019 -0700 Merge branch 'oss' of https://github.com/microsoft/qsharp-compiler into oss commit 39b9ad9ec745f9b81255c63109835368cc2e5c90 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 23:02:14 2019 -0700 documenting the built compilation commit a24ed587a8392af1abf998e8df566752ba7efc1a Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 22:15:37 2019 -0700 addressing review comments commit 7dbdb21caa288ea5bc0b184a96b2add4cc861c0f Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 22:08:36 2019 -0700 Update src/QsCompiler/CompilationManager/CompilationUnitManager.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 1c191982db105ed229c5ed5aff9af1ba0eedb6a4 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 22:07:24 2019 -0700 Update src/QsCompiler/CompilationManager/CompilationUnitManager.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit ddffbf7581039627fdacc87dcf6127330614912e Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 22:06:24 2019 -0700 Update src/QsCompiler/CompilationManager/CompilationUnitManager.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 1e42df2cca32c198b2a4c8fe0619db4b34fc55df Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 21:40:15 2019 -0700 some adaptions to teh readme commit b57dbc5811824cbc21d107d8cb4c533b106ba00e Merge: 926a001 2fda19b Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 21:21:00 2019 -0700 Merge branch 'oss' of https://github.com/microsoft/qsharp-compiler into oss commit 2fda19b5ec74f3ea4b5baee40ae61208151e38b9 Merge: d95e410 af7a779 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 21:20:37 2019 -0700 Merge pull request #21 from microsoft/beheim/contributing Contribution Guide commit af7a779d6fc1e787c0fd2f3a2f39aa4fe6060486 Merge: 0cb0a00 d95e410 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 21:04:19 2019 -0700 Merge branch 'oss' into beheim/contributing commit 926a00150a23fb8b8d2787bdc6fafb67269edded Merge: a67c601 d95e410 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 21:03:55 2019 -0700 Merge branch 'oss' of https://github.com/microsoft/qsharp-compiler into oss commit a67c601be54a508b2eabb91a666f3c17e53fb621 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 21:03:44 2019 -0700 addressing review comments commit d95e4108f9c1bb9f4739b50c362fbdc8736e50bd Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:54:11 2019 -0700 Update src/QsCompiler/Tests.Compiler/AutoGenerationTests.fs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 64d9152f3f688c4c8d2e44a8985b421ccdf0416f Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:31:12 2019 -0700 Update src/QsCompiler/LanguageServer/EditorState.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 54ebf25847a70063d3dc3a9ec1be43af5d0852c0 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:29:18 2019 -0700 Update src/QsCompiler/LanguageServer/EditorState.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 9e581800ef40591fa4232bb6d2fd602c960fdb3e Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:26:10 2019 -0700 Update src/QsCompiler/Compiler/Process.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit bcb1c45a9a9d148c8d6d6edae6ec5a5895c2c1cd Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:25:20 2019 -0700 Update src/QsCompiler/Compiler/Logging.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 08ac74217d05efed5a93b7132a6e68e480c5cceb Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:24:42 2019 -0700 Update src/VisualStudioExtension/QsharpVSIX/README.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit c344617bfc7056192e59799e7ffb39d368e6e06e Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:24:04 2019 -0700 Update src/VSCodeExtension/syntaxes/qsharp.tmLanguage.json.v.template Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit cf088e2f227d2d742399bd46558e7094d80a5848 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:23:39 2019 -0700 Update src/VSCodeExtension/src/telemetry.ts Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 8a0c1a453494685ee67174c0eadf0ebcde83b7d1 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:18:45 2019 -0700 Update src/QsCompiler/CompilationManager/Utils.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit ad97d78f920fc2748d692a9c0da16ed8436edceb Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:15:14 2019 -0700 Update src/QsCompiler/CompilationManager/CompilationUnitManager.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 51699a06231b9f4b8d0104d4bd980f47c5ed8f3f Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:14:22 2019 -0700 Update src/QsCompiler/CompilationManager/CompilationUnitManager.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 771f95a777364d3dc40aaac3317d0c079cf00813 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:12:19 2019 -0700 Update src/QsCompiler/CompilationManager/CompilationUnitManager.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 2e45dbee895f0a8b1916f39871f3f0e62ed8b617 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 20:02:16 2019 -0700 Update src/QsCompiler/CommandLineTool/TargetOptions.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit ffb0efcd84ab86718738737d169e70367be6a748 Merge: fbce1e9 59dc6e2 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 19:57:39 2019 -0700 Merge branch 'oss' of https://github.com/microsoft/qsharp-compiler into oss commit 0cb0a0019789e2f9d7fcf4cb0e131881fa68e870 Merge: 698b314 b6a6eaa Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 19:56:14 2019 -0700 Merge branch 'beheim/contributing' of https://github.com/microsoft/qsharp-compiler into beheim/contributing commit 698b314266d4e6e09d8b98b410f787230ec19995 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 19:56:04 2019 -0700 restore vs extension solution even if msbuild is not present commit b6a6eaacf4b25601252919034785d063b6053163 Merge: ae1b44b 59dc6e2 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 19:07:09 2019 -0700 Merge branch 'oss' into beheim/contributing commit ae1b44b2ead5f37bdf3d53a6d1917af5b2af49eb Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 19:06:17 2019 -0700 distinction building from source commit 5b17565ff8e426026bff4761737d7e2d369e4200 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 19:00:00 2019 -0700 Update README.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 4341d046bebce01a73d75b600e002ed4a3da5abd Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:56:04 2019 -0700 Update CONTRIBUTING.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit e67b53ce16275cea1e5c73ae2bb104348d681d4a Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:55:44 2019 -0700 Update CONTRIBUTING.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 6eb5f9842db7fbc1db2e3baa1c8544eb838abb8c Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:55:24 2019 -0700 Update CONTRIBUTING.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 01f5cb5fb35910a03c66b37f5eb29ec1a692c4a4 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:53:41 2019 -0700 Update CONTRIBUTING.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 59dc6e2782d48c2ab1d5bfbf00f81933367180ae Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:43:12 2019 -0700 Update src/QsCompiler/CommandLineTool/Commands/Build.cs Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit cf2561ad0bfca2dd62ef43d234020b878ca49ff3 Merge: 9b1d3fd 1549fcc Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:40:41 2019 -0700 Merge pull request #20 from microsoft/beheim/licences MIT licences for packages and extensions commit e35db57fdc0bc6d2d56034d02992013b5be18bb1 Merge: 1044c5c fbce1e9 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 18:38:14 2019 -0700 Merge branch 'oss' into beheim/contributing commit fbce1e917625087fbb04888d3c593a7d3df48010 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 18:37:51 2019 -0700 better error message for build scripts commit 1549fcce95e1e5d76d9e79c8c0041bf0f969e08a Merge: 4ea2205 9b1d3fd Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 18:10:49 2019 -0700 Merge branch 'oss' into beheim/licences commit 1044c5c48c3b9529385fc0f7e5aebf35fcd26289 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 18:03:13 2019 -0700 adding the links commit 30f9f786339ee4c3b4bcfa8697eabc8424797a71 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 17:52:21 2019 -0700 that should work as contribution guide commit c1527cf01bc5f43959b7e13c86681b0da2a28946 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 16:45:10 2019 -0700 revised section on contributing code commit 449b82dae48f3bb7961debdac61797545368c49a Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 16:44:34 2019 -0700 started to address review comments related to merging back to master commit def4ef76a692c4ed52de1fc7db344e97c3fcd902 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 9 16:32:56 2019 -0700 Wait 50ms for file changes before completion This seems necessary to fix some issues with completion not being triggered by the "." character in VS Code. commit 0e2c06428894160c1c0b864e83a3f66b18dfb06b Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 9 15:10:11 2019 -0700 Fix qualified symbol regex again commit 9b1d3fd660d094d645a9b8dec2b3222b600dda02 Merge: 80569af f97e82f Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 14:55:19 2019 -0700 Merge pull request #19 from microsoft/beheim/clean-up Readmes and removing left-over .net core 2.2 requirement for a test commit 4ea2205a6b445e70314c9c8b9fbc9155ac54575d Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 14:28:48 2019 -0700 and that should do for the VS extension commit 4b35156aa8b8ba0643ca05b7391d7843e1e24535 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 14:21:35 2019 -0700 that should work for VS Code commit cab03af519a89fb4ebd0eb9f5cfba7bf4f24714b Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 14:16:49 2019 -0700 mit licence for the compiler commit f97e82faa397504d5faade6d822d7174d981695b Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 13:49:50 2019 -0700 readme for both the vs and vs code extension that points to the docs for the detailed lists commit bf69f62f3b42fd8baffe7bf30d0795b4b7174333 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 9 13:00:07 2019 -0700 Don't show completions in decimal numbers commit 6434c320f9ff71aacef59ed7e97e83fc39c665d0 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 12:54:18 2019 -0700 removing the section on components in the VS Code extension readme commit 333728170390a9be7b229e172742005d101ba482 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 9 12:48:59 2019 -0700 Fix range check in GetTextIndexFromPosition * Add a check for the character being before the fragment start * Work with fragments that were gotten with includeEnd = true. commit e5bbbf2e2c007696425c616032ee589030398888 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 12:43:44 2019 -0700 pointing to the compiler repo for feedback commit 4d7dd09908e1c2e71f1a3ae6eac89f480b7f6915 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 12:26:07 2019 -0700 removing overview.md since it's not picked up an the content needs to be added manually via webpage commit 7e121722e4993b9404c47cce1242ae4a2bc4e539 Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 12:18:09 2019 -0700 removing release notes section in VS extension Overview commit d2a8b638a37e72ae8e07983d7cdf72ed1630d22c Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 11:57:00 2019 -0700 setting all unit tests to include existing packages commit aefdedfcd9972ae555fcf61199a634443baa891d Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 11:38:06 2019 -0700 package nr for test commit 34ffef9e9ec3b11637c717c23dc9f5f66dd2fece Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 11:30:34 2019 -0700 removing 2.2 requirement for a unit test commit 80569af6a1aac26158fd80f548fe08cfcf103081 Merge: b39ec15 c1fdb6d Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 9 10:19:28 2019 -0700 Merge pull request #15 from microsoft/beheim/licence Keep only one ThirdPartyNotice commit c1fdb6d4bcdb859ea50f0e4431dd113d02ee2bcc Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 10:18:26 2019 -0700 removing ETH reference in VS Code extension commit f304d32fe5b1dc7af87abc9b1b8b59333ffc6f2b Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jul 9 10:14:02 2019 -0700 Don't allow repeated dots to match qualified symbol regex commit 6b62f69635b830a450bcbec08f31dada7654b2fa Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 9 09:47:35 2019 -0700 this should be the correct notice file commit fe92ce7e85cce64bec72401610c4794ad4d1273b Merge: 1c016b7 b39ec15 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 22:56:03 2019 -0700 Merge branch 'oss' into beheim/licence commit f79eecfab1f6aab32b75049eabd7bc4673ce394c Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 8 18:13:26 2019 -0700 Use more reliable detection of qualified symbols commit b39ec15deb83eb777fe331193b9484894668f4bf Merge: 007ea09 34a9f21 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 17:34:56 2019 -0700 Merge pull request #17 from microsoft/beheim/contribution ReadMe, Contribution guide, etc. commit 34a9f21855a3e789f20a6c62dda8302086ed1a6c Merge: b4268ed 007ea09 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 17:18:29 2019 -0700 Merge branch 'oss' into beheim/contribution commit b4268ed73764702be98f2c4fc6c4d401f9d84659 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 17:01:42 2019 -0700 using relative links commit c215b6f9e444dca5cce84e48be98b91ae42878b1 Merge: e942836 265438d Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 16:19:34 2019 -0700 Merge branch 'beheim/contribution' of https://github.com/microsoft/qsharp-compiler into beheim/contribution commit e9428367260288d0df2ea6c5f4ec4df845a70357 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 16:19:27 2019 -0700 addressing Mariia's comments commit 265438d4a6c121b6aabdbc29b27cf9be62b5bfa0 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 16:08:30 2019 -0700 Update README.md Co-Authored-By: Mariia Mykhailova <mamykhai@microsoft.com> commit e7a2897cee5b5f777ed73c4cab79bcb42c5dd7ac Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 15:30:21 2019 -0700 Update README.md Co-Authored-By: Chris Granade <chgranad@microsoft.com> commit 1c016b7165bd2a064499fb3e6b6204b80658173b Merge: b819247 007ea09 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 15:06:34 2019 -0700 Merge branch 'oss' into beheim/licence commit b8192477d3dabd6c40e8c6e69469692a2ec96a5d Merge: 6ad7c84 496a600 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 14:59:17 2019 -0700 Merge branch 'beheim/licence' of https://github.com/microsoft/qsharp-compiler into beheim/licence commit 6ad7c84590679f73830a95e2085db4e7f5419035 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 14:59:09 2019 -0700 replacing ThirdPartyNotice with the correct NOTICE file commit 007ea093e6d62f57a3a5c8f78e4484f5d19cf95d Merge: c505a26 b1adf36 Author: Chris Granade <chgranad@microsoft.com> Date: Mon Jul 8 14:58:16 2019 -0700 Merge pull request #16 from microsoft/cgranade/vscode-packagejson Fix validation errors in package.json. commit 98c4f8d549966d0cf415d47604a8cb46201317c2 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 8 14:39:59 2019 -0700 Fix parsing when typing in the middle of a NS commit b9230cb1f1b389d8395f285733bba03a41a7ee1d Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 14:27:51 2019 -0700 adaption in gitignore commit b59d9dcaf2ef649d92bca1579c75c8add7767c89 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 14:14:38 2019 -0700 minor edits based on other reviews commit 73526f2cacb0a3c52652c68bde58188e7de8cd3a Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 14:08:03 2019 -0700 slight adaption to privacy.md commit 7b260534af03921ffc8afad64b258708cf705cd2 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 13:50:22 2019 -0700 feature request and bug report templates commit b1adf36ad0688d240c326c1e44e1d91d617d0880 Author: Christopher Granade <cgranade@cgranade.com> Date: Mon Jul 8 13:47:50 2019 -0700 Fix validation errors in package.json. commit 8be51ceec2187e66e85ab7c8f6caf46594f3a076 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 13:33:51 2019 -0700 adding link to powershell github commit d3eac8138c899eff4ce450be875f54734c586207 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 13:29:51 2019 -0700 forgot to mention the bootstrap script commit 28b6cd626ea6878e3e24f194aa726ca7ab602174 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 13:20:55 2019 -0700 contributing commit f98fea988020a28e1178413b8b55e2c562242257 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 8 13:18:02 2019 -0700 Show completions for namespaces commit 960c4a70874a3172e41ac6d3da6f8530470553ed Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jul 8 10:57:15 2019 -0700 readme commit 7a85dfb174c332bc40c9ade83214e782533a51ce Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 8 10:15:08 2019 -0700 Remove StringSplitOptions.RemoveEmptyEntries Blank lines shouldn't be collapsed together, I think. commit 496a600d01f3f0ecdd3cae68274cf9976732dfb9 Merge: c30e054 c505a26 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 09:34:07 2019 -0700 Merge branch 'oss' into beheim/licence commit c505a269ed89bf738710929269a584b32a2249d0 Merge: 65259b3 4e3e8ba Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Mon Jul 8 09:29:05 2019 -0700 Merge pull request #14 from microsoft/anpaz/build Public key is copied to build folder. commit 9345f92bd8dbe18a86e51e86ad858b8ae1c2ddfd Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 19:29:33 2019 -0700 Add "." as a completion trigger character commit cb8f6969e59762c5449fce9ab6e58bedfad8c426 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 19:19:33 2019 -0700 Check for nulls in GetSymbolNamespacePath commit 22e324b1a5182bf8bb0765cc9886d9df01fc8a95 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 17:47:21 2019 -0700 Show completions for qualified symbols Completions are shown for symbols inside the namespace of a qualified symbol, but the namespaces themselves aren't shown yet. commit 4e3e8ba00da386c40f4c211d5104d9576da35b9e Author: Andres Paz <anpaz@microsoft.com> Date: Fri Jul 5 16:47:07 2019 -0700 Adding Assembly.Constants variable to ci.yml commit 4fd9ef13fc528535f4d63fae95924c3fca062f4c Author: Andres Paz <anpaz@microsoft.com> Date: Fri Jul 5 10:38:19 2019 -0700 Public key is copied to build folder. commit f2f7b57de324735ff53a7cb0d3428e4b5aa83481 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 14:03:06 2019 -0700 Rename GetVisibleNamespaces to GetOpenedNamespaces This is a more accurate name. commit f3a82ba224833f3efc9256527187a322ced06306 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 13:28:28 2019 -0700 Replace switch with conditional expression in GetCallableCompletions commit 7fdbb921a161d3445b480c0f3487f20b310189ab Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 13:22:56 2019 -0700 Use function completion kind for both operations and functions commit c94978550d86fba2ae7848bfff16bdd8a4b765c7 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 13:18:08 2019 -0700 Show completions for keywords commit 671b3ab58850d12e486a7a761b7f64c1f5f78b46 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 11:40:30 2019 -0700 Clarify error handling for new methods commit 22c066f87154bca1e2bc9e01e3736bcf6dea6464 Merge: 50a02f3 0b8b2a5 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 10:05:10 2019 -0700 Merge from features/languageServer commit 50a02f38da0b10049295c59183e52c5816d21152 Merge: f74809f b500b26 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jul 5 09:44:01 2019 -0700 Merge branch 'features/languageServer' into marshallsa/completionGlobals commit 0b8b2a5d3bc982353b618ab48700277d818829fe Merge: 12ce309 1068730 Author: Sarah Marshall <33814365+marshallsa@users.noreply.github.com> Date: Wed Jul 3 20:56:56 2019 -0700 Merge pull request #8 from microsoft/marshallsa/completion-locals Add language server completion for local variables commit 10687301d4b65546709ae0904a856f2d83c82e2a Merge: fc7abcd 12ce309 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Wed Jul 3 18:41:52 2019 -0700 Merge branch 'features/languageServer' into marshallsa/completion-locals commit 12ce309c9a8d79d517a616c502de6fca3f8f56b8 Merge: b500b26 22904b8 Author: Sarah Marshall <33814365+marshallsa@users.noreply.github.com> Date: Wed Jul 3 18:31:59 2019 -0700 Merge pull request #10 from microsoft/marshallsa/vsIndent Add automatic indentation to Visual Studio extension commit c30e054f00e2556172d8b31a7f5ff5d2da332467 Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 3 18:24:50 2019 -0700 only have one ThirdPartyNotice at the repo root and copy it from there when packaging the extensions commit fc7abcd182a066a0cb574b942e493243a8ecace5 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 18:07:52 2019 -0700 Update completion provider in capabilities test commit c0451301f26dc02d478e64fb52a8e2f05dfa534c Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 17:27:05 2019 -0700 Build test commit d1035cf422f60592091b5f0c9c79731c9d008a09 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 17:26:56 2019 -0700 Build test commit 22904b89b02f135632deb5161ac9eabd1178038d Merge: 9d4d092 b500b26 Author: Sarah Marshall <33814365+marshallsa@users.noreply.github.com> Date: Wed Jul 3 17:10:23 2019 -0700 Merge branch 'features/languageServer' into marshallsa/vsIndent commit 8de21aaf8a3edcd77949803bf5b90faa09759d64 Merge: 0a2f94c b500b26 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 16:55:16 2019 -0700 Merge branch 'features/languageServer' into marshallsa/completion-locals commit b500b26f566b5d97359a8403a63e718894cbbe00 Merge: 2a48973 65259b3 Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 3 16:44:22 2019 -0700 Merge branch 'oss' into features/languageServer commit 65259b39f0c0f16ca3bc81b2290d2c1e8170ed40 Merge: 9c82179 2bedf1b Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Wed Jul 3 16:33:33 2019 -0700 Merge pull request #12 from microsoft/beheim/vscode Package fixes for VS Code extensions commit 2bedf1b3d43978208b81bc67bb3b4bb1210d0e17 Merge: 3a9faff 9c82179 Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 3 16:17:14 2019 -0700 Merge branch 'oss' into beheim/vscode commit 3a9faff2bbcd67538d4a98b73f5c25b2065d8e03 Author: Bettina Heim <beheim@microsoft.com> Date: Wed Jul 3 16:14:22 2019 -0700 removing the open package commit 9d4d092f29b604ceff211a69adb29410abda8375 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 16:12:37 2019 -0700 Add note about nullable return type of GetDesiredIndentation commit c4fad636c62ba8c73a33e8ec294e726ec6eb295f Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 16:04:31 2019 -0700 Add doc comment to GetDesiredIndentation commit 247406c498645342effd3b1099fa7b7bd3939382 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 15:57:42 2019 -0700 Flip order of ternary operator in GetIndentation commit 9c8217941c43a03bb97c503ab76c1f8814a6c856 Author: Andres Paz <anpaz@microsoft.com> Date: Wed Jul 3 15:49:48 2019 -0700 Moving to scripts based build (#9) commit 4e97d4b58059745226ad140aafd83035c16c5d65 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 15:46:21 2019 -0700 Move QsSmartIndentProvider to the top of the file commit f3524833c6c7f667d92400a2b2246ba5775ef709 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 15:33:16 2019 -0700 Remove assumption from GetLastNonEmptyLine commit 0a2f94c6a25abedaba229584666c1d1222bc0fd2 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 12:37:32 2019 -0700 Clarify what happens when an invalid position is passed to a completion method commit babd519ed26625c972309dfcf560f02ef9deff1a Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 12:14:09 2019 -0700 Add try/catch to completion request handler commit c0116b301838a9e0a17095480d121a50b6d1a465 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 12:05:31 2019 -0700 Add TODO about delaying diagnostics commit ec5446426d0ca9a91646ce9ff6ac85f7bbc50134 Author: Sarah Marshall <t-samars@microsoft.com> Date: Wed Jul 3 12:01:22 2019 -0700 Clarify what happens with null parameters in completion methods commit c32a8601293bbf0e35bd7fbad437eb3d8c30e31f Merge: 67d6e1c 2b5d585 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jul 2 16:31:38 2019 -0700 Merge pull request #11 from microsoft/beheim/bugFixes Fixing typo that causes stackoverflow exception commit 2b5d585068e6cb1ef83d939c9aca3cc61f3b3b2f Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 2 15:23:12 2019 -0700 renaming commit d93ca805a2f2a2f91b56ddbddde5640ff982048c Author: Bettina Heim <beheim@microsoft.com> Date: Tue Jul 2 13:12:50 2019 -0700 fixing a rather bad typo that causes the server to crash... commit f74809f71f7d4a047958e24ef07e3f3bd5f51388 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 1 18:07:09 2019 -0700 Use a different completion item kind for type constructors commit e47d34894a19d5007aee37db78f971f112e9fb88 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 1 17:30:43 2019 -0700 Show completions for user-defined types commit 9a6d5af64bb0f10c64dfd1d55733ee323d692fd9 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 1 15:21:25 2019 -0700 Show completions for callables in opened namespaces commit 485b49625977eaad4ad3ab6ec2c9a854d2b24e43 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 1 14:05:15 2019 -0700 Show completions for global callables in the current namespace commit dd8c4bb113e2b9effa807fbff858fea7cb4cdea9 Author: Sarah Marshall <t-samars@microsoft.com> Date: Mon Jul 1 10:01:30 2019 -0700 Find the indentation of the last non-empty line The previous line can be empty, which would reset the indentation to 0 if e.g. you pressed enter twice in a row. Loop backwards to find the last non-empty line and use that line's indentation instead. commit 63dcea8dc0382e3ed85c05023427426c0c641105 Author: Sarah Marshall <t-samars@microsoft.com> Date: Sat Jun 29 15:34:32 2019 -0700 Add automatic indentation to Visual Studio extension commit 67d6e1c3c7f9df8246bfed74f62755663da9219a Merge: 60767d2 9202b17 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Sat Jun 29 12:51:10 2019 -0700 Merge pull request #5 from microsoft/beheim/wrapUp Moving solutions to the top commit 7a7bffaee6e7f5cc17b5b14da63cf0b52ff6eb78 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 18:46:52 2019 -0700 Remove "using SymbolKind = ..." from EditorSupport.cs This isn't needed anymore. commit 635372b72fc09e059dff34723b2c055e36119afe Merge: 4bd8999 2a48973 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 18:37:03 2019 -0700 Merge branch 'features/languageServer' into marshallsa/languageServer commit 4bd8999d60dc1f54f847c636dd569d25cd467fd5 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 17:35:15 2019 -0700 Remove document symbols from completion list Too complicated to do correctly right now. These will come back when we look into all symbols in the current namespace and opened namespaces. commit 1dfac8bd2198c7e416159f8b121bb9ce87e31426 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 17:33:13 2019 -0700 Add the rest of the cases for IsDeclaringNewSymbol commit 65cf7f762cf701bdf7b16622832eaa924e2a6db1 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 17:30:45 2019 -0700 Don't delay updates for changes with valid symbol characters This fixes a couple issues where completion wasn't able to reliably tell what context the cursor is in. commit 9202b17cc814ad214c9144d33225fbb703236eb9 Author: Bettina Heim <beheim@microsoft.com> Date: Fri Jun 28 17:14:38 2019 -0700 proper setup for telemetry commit dabffe5ff67910696d5b1c9762b2fc565dcc51b5 Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 14:19:10 2019 -0700 Set the completion kind based on symbol kind commit 9ca187261ceb1c3d238261d6ca180236a57fd6d0 Author: Bettina Heim <beheim@microsoft.com> Date: Fri Jun 28 14:14:27 2019 -0700 moving bootstrap to root folder and renaming Set-VersionNumber commit 2a48973f80ed86c19439341aa54972f10fd733ab Merge: 512e4d2 60767d2 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Fri Jun 28 13:30:53 2019 -0700 Merge pull request #6 from microsoft/beheim/languageServer Getting updates from master (oss) commit a14e4ea07ee07ccc9a73a7f6975537464df76262 Merge: 253d1e2 d3a7665 Author: Bettina Heim <beheim@microsoft.com> Date: Fri Jun 28 13:18:11 2019 -0700 Merge branch 'beheim/wrapUp' of https://github.com/microsoft/qsharp-compiler into beheim/wrapUp commit 253d1e2a829717238a5d8d5afe0aed45b2d3a042 Author: Bettina Heim <beheim@microsoft.com> Date: Fri Jun 28 13:18:04 2019 -0700 correct path for package dir commit 492206405acbeb38c244e3f9e5cbf71cf866552d Author: Sarah Marshall <t-samars@microsoft.com> Date: Fri Jun 28 13:05:32 2019 -0700 Don't suggest completions at the start of a let/mutable binding commit d3a7665bc6355e0a2e536968aafc58e8ae00b351 Merge: aa23c7f 60767d2 Author: Andres Paz <anpaz@microsoft.com> Date: Fri Jun 28 12:58:09 2019 -0700 Merge branch 'oss' into beheim/wrapUp commit 5f69e4e06205b7ac12068e07cd5af063fb958a74 Merge: aa23c7f 60767d2 Author: Bettina Heim <beheim@microsoft.com> Date: Fri Jun 28 12:53:42 2019 -0700 Merge branch 'oss' into beheim/wrapUp commit 60767d24051accc0cd63ab89c5cabf90551c7145 Merge: 1d1c14a 7913e6d Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Fri Jun 28 12:53:15 2019 -0700 Merge pull request #2 from microsoft/beheim/oss Missing copyright headers commit aa23c7f986cbdffd9543787b800cf96dce159107 Author: Bettina Heim <beheim@microsoft.com> Date: Fri Jun 28 10:37:02 2019 -0700 moving solutions to the top and removing project templates commit 15794b445f896655684eba3651187f30b180aee4 Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jun 27 21:59:43 2019 -0700 Remove "." from completion trigger characters We don't support completion inside namespaces at all right now, so I don't think "." needs to be a trigger character. This fixes the problem where completion is triggered while typing a decimal number. commit 7913e6d520f5ab02e4256884e9b197928822a3f8 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 18:27:23 2019 -0700 forgot something commit 215efb1efef490890775e4f3d50142083eb8a898 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 18:08:52 2019 -0700 switching back to .net core 2.1 commit f211600dc621faf957d3398b6414e482bde7f985 Merge: 0a8dd04 47040bc Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 17:47:30 2019 -0700 Merge branch 'beheim/oss' of https://github.com/microsoft/qsharp-compiler into beheim/oss commit 0a8dd04b7d0c794711e8e1080a2093dbaceee935 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 17:47:09 2019 -0700 version requirement 2.1 commit 9bb36fef254ed6fc742444c0c8126bb4fd90dab0 Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jun 27 15:35:49 2019 -0700 Fix the position if the character index is longer than the line This way we don't have to update the file immediately and we can avoid the red squigglies. commit 47040bc89bf3b52134a6bbfd9ce74d49b27e4661 Merge: 785494c 1d1c14a Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Thu Jun 27 15:20:29 2019 -0700 Merge branch 'oss' into beheim/oss commit 785494c62ebfc537e816ffe0e79087e3a3f84419 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 15:19:11 2019 -0700 missing comma commit c0b05cd27d3a9b1936cc60f7342b60b33f1c6ecb Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 15:04:39 2019 -0700 semver fix commit 456351975d29e8b8e4a31daf53db0db1645e37e7 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 15:01:12 2019 -0700 handling telemetry for VS Code commit a1596519aaa3184222f93535233acda0264a3d0c Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 14:27:01 2019 -0700 ...ps script commit 9a45f75e785e0315ba035f7d928b7720f873722f Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 14:20:10 2019 -0700 semver commit 18d0c90ad0983c92fb8b28c27ecb859168cf427b Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jun 27 13:03:09 2019 -0700 Add doc comment for EditorSupport.Completions commit f9fae7cbb617b3623325b554d67a4bd5ff810562 Author: Sarah Marshall <t-samars@microsoft.com> Date: Thu Jun 27 12:58:26 2019 -0700 Include local variables in completion list commit 1d1c14ad8192b30401b8a29724001993022a691c Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Thu Jun 27 11:53:49 2019 -0700 component detection (#4) * component detection * switching to 2.2 for all dotnet core apps * vs code package commit eacd59bfc54bb07b57a45005855b226a351c6896 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 11:01:07 2019 -0700 setting the vsix version commit 64179d673813eabd97c02d022cf8bbb60265f581 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 10:39:38 2019 -0700 typo and gitignore commit 16786490b3a1f22dd3ce0e3d93aead427711cd34 Merge: da855c2 2e853fe Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 10:15:16 2019 -0700 Merge branch 'oss' into beheim/oss commit da855c2fb8f4a3e7eb45e1f7bb029bbaadaecde9 Author: Bettina Heim <beheim@microsoft.com> Date: Thu Jun 27 10:13:52 2019 -0700 replacing the setVersionNr script commit a0ba054a583821b7336cc7eec027051288c35451 Author: Sarah Marshall <t-samars@microsoft.com> Date: Tue Jun 25 15:17:04 2019 -0700 Add a very simple first start for code completion commit 2e853fef725d04830df6a4456f5af619c8f5bc6d Merge: 512e4d2 9cc8d0d Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Tue Jun 25 00:15:54 2019 -0700 Merge pull request #3 from microsoft/beheim/docComments XML format for doc comments in C# code commit 9cc8d0dd0b81164811424fa7cf4e71c64be695b3 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 23:59:25 2019 -0700 that should do it commit a40fa01e8c876805e77954049a74bce855009f8f Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 23:54:08 2019 -0700 doc comment cleanup compilation manager commit 1802ab98dd1e3bee161a4dadbbebeb437567930c Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 23:14:33 2019 -0700 xml comments for transformations commit 55d8f51ec09235ad7b216004978baf6fef401c0a Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 23:07:36 2019 -0700 xml comments for the language server commit 01640afb80428b73b810e65304bfada452f6bc59 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 22:58:21 2019 -0700 xml comments for compiler commit 542e858866d3922d0304786d91b45443840035c2 Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 22:45:46 2019 -0700 xml comments for the compilation manager commit 536c5a6dd64c23a70c9832ef66ca4bbbeddb956d Author: Bettina Heim <beheim@microsoft.com> Date: Mon Jun 24 20:04:09 2019 -0700 xml doc comments for the command line compiler commit e46c118d90bff113a502029b2da9884b3daadbfa Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 22:08:12 2019 -0700 going over the vs code extension folder commit b9fd678e371267a427ec29d68ba127712d138e7c Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 21:36:22 2019 -0700 editing PRIVACY.md to specify that the VS extension does collect data if the corresponding VS Code setting is chosen by the application user commit 512bc459d4713803a25d7303b8fb084e308e8fa5 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 20:20:05 2019 -0700 forgot a couple of copyright headers commit ba0a71ec15e93748eeb40f3714eed6fda88cea14 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 20:03:00 2019 -0700 disabling telemetry unless TELEMETRY is defined in the VS extension commit 512e4d2963c54a7273bdfb7951602af4cf058a59 Merge: e3acf5a 3872499 Author: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Sun Jun 23 17:10:22 2019 -0700 Merge pull request #1 from microsoft/beheim/oss moving build scripts into build folder commit 38724997401fa8cdd9f174d3551db21221cbdd21 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 16:47:12 2019 -0700 renaming build step commit 78f2c3d8e4be38a04198af9bed467c5d0558e1d7 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 16:41:50 2019 -0700 removing sdl steps commit 3b61ab0d8e72156e3e038bd41a46e356a0fd76ed Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 16:37:51 2019 -0700 typo in build steps commit f0059be9373f647fc5206f723d3d328482e85cc7 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 16:36:16 2019 -0700 moving build scripts into build folder commit e3acf5ab64847c4bfd73a469ee20aa7fcd6e9b50 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 16:10:21 2019 -0700 first draft for build setup commit 37981a06910eec23295baa9df3caa6c3ea8fbe55 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 15:13:27 2019 -0700 extensions commit b0ca30bf31c0bba8875a435eb4cff91ff78b3717 Author: Bettina Heim <beheim@microsoft.com> Date: Sun Jun 23 10:33:52 2019 -0700 notices etc commit 9bb01c3d3116414a427a2f8c7822d722a1fe66d2 Author: Bettina Heim <beheim@microsoft.com> Date: Sat Jun 22 15:11:51 2019 -0700 renaming folder commit 18591767ba17d4aba4d27e7fdc83856a2d802454 Author: Bettina Heim <beheim@microsoft.com> Date: Sat Jun 22 15:07:42 2019 -0700 initial commit with the compiler solution
1 parent b65853c commit ee1c17a

File tree

10 files changed

+704
-8
lines changed

10 files changed

+704
-8
lines changed

src/QsCompiler/CompilationManager/EditorSupport.cs

Lines changed: 421 additions & 2 deletions
Large diffs are not rendered by default.

src/QsCompiler/CompilationManager/FileContentManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,14 @@ internal void PushChange(TextDocumentContentChangeEvent change, out bool queuedC
811811
queuedChange = false;
812812
if (count == 1 && line == start)
813813
{
814-
// if the change contains any characters that cannot occur in a symbol, trigger an update
814+
// TODO: If the change contains characters that are part of a symbol, we should delay sending
815+
// diagnostics until the user has a chance to finish typing, either by queuing the update here or
816+
// queuing the diagnostics before they're sent to the client.
815817
this.UnprocessedUpdates.Enqueue(change);
816818
var trimmedText = change.Text.TrimStart(); // tabs etc inserted by the editor come squashed together with the next inserted character
817819
if (change.Text == String.Empty ||
818820
trimmedText == "{" || trimmedText == "\"" || // let's not immediately trigger an update for these, hoping the matching one will come right after
819-
trimmedText == "\\" || trimmedText == "/" || // ... and the same here
820-
Utils.ValidAsSymbol.IsMatch(trimmedText))
821+
trimmedText == "\\" || trimmedText == "/") // ... and the same here
821822
{
822823
this.Timer.Start(); // we can simply queue this update - no need to actually execute it
823824
queuedChange = true;

src/QsCompiler/CompilationManager/ProjectManager.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,35 @@ public ImmutableDictionary<string, WorkspaceEdit> CodeActions(CodeActionParams p
901901
this.Manager(param?.TextDocument?.Uri)?.FileQuery
902902
(param?.TextDocument, (file, c) => file.CodeActions(c, param?.Range, param.Context), suppressExceptionLogging: true);
903903

904+
/// <summary>
905+
/// Returns a list of suggested completion items for the given location.
906+
/// <para/>
907+
/// Returns null if given uri is null or if the specified file is not listed as source file. Fails silently
908+
/// without logging anything if an exception occurs upon evaluating the query (occasional failures are to be
909+
/// expected as the evaluation is a readonly query running in parallel to the ongoing processing).
910+
/// </summary>
911+
public CompletionList Completions(TextDocumentPositionParams param) =>
912+
this.Manager(param?.TextDocument?.Uri)?.FileQuery(
913+
param?.TextDocument,
914+
(file, compilation) => file.Completions(compilation, param?.Position),
915+
suppressExceptionLogging: true);
916+
917+
/// <summary>
918+
/// Resolves additional information for the given completion item.
919+
/// <para/>
920+
/// Returns null if the completion item data is null, the file URI given in the data is null, or if the file is
921+
/// not a source file.
922+
/// <para/>
923+
/// Fails silently without logging anything if an exception occurs upon evaluating the query (occasional
924+
/// failures are to be expected as the evaluation is a read-only query running in parallel to the ongoing
925+
/// processing).
926+
/// </summary>
927+
public CompletionItem ResolveCompletion(CompletionItem item, CompletionItemData data, MarkupKind format) =>
928+
this.Manager(data?.TextDocument?.Uri)?.FileQuery(
929+
data.TextDocument,
930+
(_, compilation) => compilation.ResolveCompletion(item, data, format),
931+
suppressExceptionLogging: true);
932+
904933

905934
// routines related to querying the state of the project manager
906935
// -> these routines will wait for any processing to finish before executing the query

src/QsCompiler/CompilationManager/Utils.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public static class Utils
5252
/// </summary>
5353
internal static readonly Regex ValidAsSymbol = new Regex(@"^[\p{L}_]([\p{L}\p{Nd}_]*)$");
5454
/// <summary>
55+
/// matches qualified symbols before the starting position (right-to-left), including incomplete qualified
56+
/// symbols that end with a dot
57+
/// </summary>
58+
internal static readonly Regex QualifiedSymbolRTL =
59+
new Regex(@"([\p{L}_][\p{L}\p{Nd}_]*\.?)+", RegexOptions.RightToLeft);
60+
/// <summary>
5561
/// matches a line and its line ending, and a *non-empty* line without line ending at the end
5662
/// </summary>
5763
private static readonly Regex EditorLine = new Regex($"({NonBreakingChar}*({LineBreak}))|({NonBreakingChar}+$)");

src/QsCompiler/DataStructures/SymbolTable.fs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,24 @@ and NamespaceManager
613613
| false, _ -> ArgumentException "no namespace with the given name exists" |> raise
614614
| true, ns -> Some ns
615615

616+
/// Returns the name of all namespaces declared in source files or referenced assemblies.
617+
member this.NamespaceNames () =
618+
syncRoot.EnterReadLock()
619+
try ImmutableArray.CreateRange (Namespaces.Values.Select (fun ns -> ns.Name))
620+
finally syncRoot.ExitReadLock()
621+
622+
/// Returns the fully qualified namespace name of the given namespace alias (short name). If the alias is already a
623+
/// fully qualified name, returns the name unchanged. Returns null if no such name exists within the given parent
624+
/// namespace and source file.
625+
///
626+
/// Throws an ArgumentException if the given parent namespace does not exist.
627+
member this.TryResolveNamespaceAlias alias (nsName, source) =
628+
syncRoot.EnterReadLock()
629+
try match TryResolveQualifier alias (nsName, source) with
630+
| None -> null
631+
| Some ns -> ns.Name.Value
632+
finally syncRoot.ExitReadLock()
633+
616634
/// Fully (i.e. recursively) resolves the given Q# type used within the given parent in the given source file.
617635
/// The resolution consists of replacing all unqualified names for user defined types by their qualified name.
618636
/// Generates an array of diagnostics for the cases where no user defined type of the specified name (qualified or unqualified) can be found.
@@ -644,7 +662,9 @@ and NamespaceManager
644662
let processTP (symName, range) =
645663
if tpNames |> Seq.contains symName then TypeParameter {Origin = parent; TypeName = symName; Range = qsType.Range}, [||]
646664
else InvalidType, [| range |> QsCompilerDiagnostic.Error (ErrorCode.UnknownTypeParameterName, []) |]
647-
SymbolResolution.ResolveType (processUDT, processTP) qsType
665+
syncRoot.EnterReadLock()
666+
try SymbolResolution.ResolveType (processUDT, processTP) qsType
667+
finally syncRoot.ExitReadLock()
648668

649669
/// Resolves the underlying type as well as all named and unnamed items for the given type declaration in the specified source file.
650670
/// IMPORTANT: for performance reasons does *not* verify if the given the given parent and/or source file is consistent with the defined types.

src/QsCompiler/LanguageServer/EditorState.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,27 @@ public SymbolInformation[] DocumentSymbols(DocumentSymbolParams param) =>
358358
public ImmutableDictionary<string, WorkspaceEdit> CodeActions(CodeActionParams param) =>
359359
ValidFileUri(param?.TextDocument?.Uri) && !IgnoreFile(param.TextDocument.Uri) ? this.Projects.CodeActions(param) : null;
360360

361+
/// <summary>
362+
/// Returns a list of suggested completion items for the given location.
363+
/// <para/>
364+
/// Returns null if the given file is listed as to be ignored, or if the given parameter or its uri is null.
365+
/// </summary>
366+
public CompletionList Completions(TextDocumentPositionParams param) =>
367+
ValidFileUri(param?.TextDocument?.Uri) && !IgnoreFile(param.TextDocument.Uri)
368+
? this.Projects.Completions(param)
369+
: null;
370+
371+
/// <summary>
372+
/// Resolves additional information for the given completion item.
373+
/// <para/>
374+
/// Returns null if any parameter is null or the file given in the original completion request is invalid or
375+
/// ignored.
376+
/// </summary>
377+
internal CompletionItem ResolveCompletion(CompletionItem item, CompletionItemData data, MarkupKind format) =>
378+
item != null && ValidFileUri(data?.TextDocument?.Uri) && !IgnoreFile(data.TextDocument.Uri)
379+
? this.Projects.ResolveCompletion(item, data, format)
380+
: null;
381+
361382

362383
// utils to query the editor state server for testing purposes
363384
// -> explicitly part of this class because any access to the resources may need to be coordinated as well

src/QsCompiler/LanguageServer/LanguageServer.cs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Threading.Tasks;
1111
using System.Reactive.Linq;
1212
using Microsoft.Quantum.QsCompiler;
13+
using Microsoft.Quantum.QsCompiler.CompilationBuilder;
1314
using Microsoft.VisualStudio.LanguageServer.Protocol;
1415
using Newtonsoft.Json;
1516
using Newtonsoft.Json.Linq;
@@ -157,7 +158,7 @@ public object Initialize(JToken arg)
157158
var capabilities = new ServerCapabilities
158159
{
159160
TextDocumentSync = new TextDocumentSyncOptions(),
160-
CompletionProvider = null,
161+
CompletionProvider = new CompletionOptions(),
161162
SignatureHelpProvider = new SignatureHelpOptions(),
162163
ExecuteCommandProvider = new ExecuteCommandOptions(),
163164
};
@@ -174,6 +175,8 @@ public object Initialize(JToken arg)
174175
capabilities.DocumentHighlightProvider = true;
175176
capabilities.SignatureHelpProvider.TriggerCharacters = new[] { "," };
176177
capabilities.ExecuteCommandProvider.Commands = new[] { CommandIds.ApplyEdit }; // do not declare internal capabilities
178+
capabilities.CompletionProvider.ResolveProvider = true;
179+
capabilities.CompletionProvider.TriggerCharacters = new[] { "." };
177180

178181
this.WaitForInit = null;
179182
return new InitializeResult { Capabilities = capabilities };
@@ -452,5 +455,42 @@ bool FileIsWithinProjectDir(Uri projFile)
452455
foreach (var fileEvent in changes.Where(IsDll))
453456
{ _ = this.EditorState.AssemblyDidChangeOnDiskAsync(fileEvent.Uri); }
454457
}
458+
459+
[JsonRpcMethod(Methods.TextDocumentCompletionName)]
460+
public async Task<CompletionList> OnTextDocumentCompletionAsync(JToken arg)
461+
{
462+
// Wait for the file manager to finish processing any changes that happened right before this completion
463+
// request.
464+
await Task.Delay(50);
465+
try
466+
{
467+
return QsCompilerError.RaiseOnFailure(
468+
() => EditorState.Completions(Utils.TryJTokenAs<TextDocumentPositionParams>(arg)),
469+
"Completions threw an exception");
470+
}
471+
catch
472+
{
473+
return null;
474+
}
475+
}
476+
477+
[JsonRpcMethod(Methods.TextDocumentCompletionResolveName)]
478+
public CompletionItem OnTextDocumentCompletionResolve(JToken arg)
479+
{
480+
try
481+
{
482+
var item = Utils.TryJTokenAs<CompletionItem>(arg);
483+
var data = Utils.TryJTokenAs<CompletionItemData>(JToken.FromObject(item?.Data));
484+
var format = ChooseFormat(
485+
this.ClientCapabilities?.TextDocument?.SignatureHelp?.SignatureInformation?.DocumentationFormat);
486+
return QsCompilerError.RaiseOnFailure(
487+
() => EditorState.ResolveCompletion(item, data, format),
488+
"ResolveCompletion threw an exception");
489+
}
490+
catch
491+
{
492+
return null;
493+
}
494+
}
455495
}
456496
}

src/QsCompiler/Tests.LanguageServer/Tests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ public async Task ServerCapabilitiesAsync()
7676
Assert.IsNotNull(initReply.Capabilities.TextDocumentSync);
7777
Assert.IsNotNull(initReply.Capabilities.TextDocumentSync.Save);
7878
Assert.IsNull(initReply.Capabilities.CodeLensProvider);
79-
Assert.IsNull(initReply.Capabilities.CompletionProvider);
79+
Assert.IsNotNull(initReply.Capabilities.CompletionProvider);
80+
Assert.IsTrue(initReply.Capabilities.CompletionProvider.ResolveProvider);
81+
Assert.IsNotNull(initReply.Capabilities.CompletionProvider.TriggerCharacters);
82+
Assert.IsTrue(initReply.Capabilities.CompletionProvider.TriggerCharacters.SequenceEqual(new[] { "." }));
8083
Assert.IsNotNull(initReply.Capabilities.SignatureHelpProvider?.TriggerCharacters);
8184
Assert.IsTrue(initReply.Capabilities.SignatureHelpProvider.TriggerCharacters.Any());
8285
Assert.IsNotNull(initReply.Capabilities.ExecuteCommandProvider?.Commands);
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
using Microsoft.VisualStudio.Text;
2+
using Microsoft.VisualStudio.Text.Editor;
3+
using Microsoft.VisualStudio.Text.Editor.OptionsExtensionMethods;
4+
using Microsoft.VisualStudio.Utilities;
5+
using System;
6+
using System.Collections.Immutable;
7+
using System.ComponentModel.Composition;
8+
using System.Linq;
9+
10+
namespace Microsoft.Quantum.QsLanguageExtensionVS
11+
{
12+
[ContentType("Q#")]
13+
[Export(typeof(ISmartIndentProvider))]
14+
internal class QsSmartIndentProvider : ISmartIndentProvider
15+
{
16+
public ISmartIndent CreateSmartIndent(ITextView textView) => new QsSmartIndent(textView);
17+
}
18+
19+
internal class QsSmartIndent : ISmartIndent
20+
{
21+
/// <summary>
22+
/// A list of all opening and closing bracket pairs that affect indentation.
23+
/// </summary>
24+
private static readonly IImmutableList<(string open, string close)> brackets = ImmutableList.Create(new[]
25+
{
26+
("[", "]"),
27+
("(", ")"),
28+
("{", "}")
29+
});
30+
31+
/// <summary>
32+
/// The text view that this smart indent is handling indentation for.
33+
/// </summary>
34+
private readonly ITextView textView;
35+
36+
/// <summary>
37+
/// Creates a new smart indent.
38+
/// </summary>
39+
/// <param name="textView">The text view that this smart indent is handling indentation for.</param>
40+
public QsSmartIndent(ITextView textView)
41+
{
42+
this.textView = textView;
43+
44+
// The ISmartIndent interface is only for indenting blank lines or indenting after pressing enter. To
45+
// decrease the indent after typing a closing bracket, we have to watch for changes manually.
46+
textView.TextBuffer.ChangedHighPriority += TextBuffer_ChangedHighPriority;
47+
}
48+
49+
public void Dispose()
50+
{
51+
}
52+
53+
/// <summary>
54+
/// Returns the number of spaces to place at the start of the line, or null if there is no desired indentation.
55+
/// </summary>
56+
public int? GetDesiredIndentation(ITextSnapshotLine line)
57+
{
58+
// Note: The ISmartIndent interface requires that the return type is nullable, but we always return a
59+
// value.
60+
61+
if (line.LineNumber == 0)
62+
return 0;
63+
64+
ITextSnapshotLine lastNonEmptyLine = GetLastNonEmptyLine(line);
65+
int desiredIndent = GetIndentation(lastNonEmptyLine.GetText());
66+
int indentSize = textView.Options.GetIndentSize();
67+
if (StartsBlock(lastNonEmptyLine.GetText()))
68+
desiredIndent += indentSize;
69+
if (EndsBlock(line.GetText()))
70+
desiredIndent -= indentSize;
71+
return Math.Max(0, desiredIndent);
72+
}
73+
74+
private void TextBuffer_ChangedHighPriority(object sender, TextContentChangedEventArgs e)
75+
{
76+
foreach (ITextChange change in e.Changes)
77+
{
78+
if (EndsBlock(change.NewText))
79+
{
80+
ITextSnapshotLine line = e.After.GetLineFromPosition(change.NewPosition);
81+
int indent = GetIndentation(line.GetText());
82+
int desiredIndent = GetDesiredIndentation(line) ?? 0;
83+
if (indent != desiredIndent)
84+
e.After.TextBuffer.Replace(
85+
new Span(line.Start.Position, line.GetText().TakeWhile(IsIndentation).Count()),
86+
CreateIndentation(desiredIndent));
87+
}
88+
}
89+
}
90+
91+
/// <summary>
92+
/// Returns the current indentation of the line in number of spaces.
93+
/// </summary>
94+
private int GetIndentation(string line) =>
95+
line
96+
.TakeWhile(IsIndentation)
97+
.Aggregate(0, (indent, c) => indent + (c == '\t' ? textView.Options.GetTabSize() : 1));
98+
99+
/// <summary>
100+
/// Returns a string containing spaces or tabs (depending on the text view options) to match the given
101+
/// indentation.
102+
/// </summary>
103+
private string CreateIndentation(int indent)
104+
{
105+
if (textView.Options.IsConvertTabsToSpacesEnabled())
106+
return new string(' ', indent);
107+
else
108+
return
109+
new string('\t', indent / textView.Options.GetTabSize()) +
110+
new string(' ', indent % textView.Options.GetTabSize());
111+
}
112+
113+
/// <summary>
114+
/// Returns true if the end of the line starts a block.
115+
/// </summary>
116+
private static bool StartsBlock(string line) =>
117+
brackets.Any(bracket => line.TrimEnd().EndsWith(bracket.open));
118+
119+
/// <summary>
120+
/// Returns true if the beginning of the line ends a block.
121+
/// </summary>
122+
private static bool EndsBlock(string line) =>
123+
brackets.Any(bracket => line.TrimStart().StartsWith(bracket.close));
124+
125+
/// <summary>
126+
/// Returns true if the character is an indentation character (a space or a tab).
127+
/// </summary>
128+
private static bool IsIndentation(char c) => c == ' ' || c == '\t';
129+
130+
/// <summary>
131+
/// Returns the last non-empty line before the given line. If all of the lines before the given line are empty,
132+
/// returns the first line of the snapshot instead.
133+
/// <para/>
134+
/// Returns null if the given line is the first line in the snapshot.
135+
/// </summary>
136+
private static ITextSnapshotLine GetLastNonEmptyLine(ITextSnapshotLine line)
137+
{
138+
int lineNumber = line.LineNumber - 1;
139+
if (lineNumber < 0)
140+
return null;
141+
while (lineNumber > 0 && line.Snapshot.GetLineFromLineNumber(lineNumber).Length == 0)
142+
lineNumber--;
143+
return line.Snapshot.GetLineFromLineNumber(lineNumber);
144+
}
145+
}
146+
}

0 commit comments

Comments
 (0)