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

Documentation in the Suggestions Database #1791

Merged
merged 31 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e2ae902
save
BinarySoftware Jun 5, 2021
bef2d36
save
BinarySoftware Jun 5, 2021
5bdfd4a
save
BinarySoftware Jun 5, 2021
d066964
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 8, 2021
4177f64
compiles
BinarySoftware Jun 8, 2021
afe2ae3
compiles
BinarySoftware Jun 8, 2021
05debae
save
BinarySoftware Jun 8, 2021
82bf9af
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 8, 2021
d5d1ff0
save
BinarySoftware Jun 8, 2021
7462227
save
BinarySoftware Jun 8, 2021
2f97917
save
BinarySoftware Jun 8, 2021
2874b87
remove SuggestionOrderDatabase
BinarySoftware Jun 9, 2021
e22e64a
save
BinarySoftware Jun 9, 2021
f3157c6
disable for now
BinarySoftware Jun 10, 2021
dd74f29
disable for now
BinarySoftware Jun 10, 2021
26b8f1a
disable for now
BinarySoftware Jun 10, 2021
5ca0516
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 11, 2021
518f766
save
BinarySoftware Jun 11, 2021
0480543
save
BinarySoftware Jun 11, 2021
56d88c8
save
BinarySoftware Jun 11, 2021
2f90295
save
BinarySoftware Jun 11, 2021
837f149
save
BinarySoftware Jun 11, 2021
b768995
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 15, 2021
58ee022
pass
BinarySoftware Jun 15, 2021
32f6083
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 20, 2021
76ea064
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 21, 2021
a92f615
save
BinarySoftware Jun 21, 2021
98f1e28
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 22, 2021
9737997
Merge remote-tracking branch 'origin/main' into wip/mm/docs-ls
BinarySoftware Jun 22, 2021
26545b6
save
BinarySoftware Jun 22, 2021
0aa5c82
save
BinarySoftware Jun 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
Launcher and the Project Manager.
- Added documentation and a minimal tool for hosting custom library repositories
([#1804](https://github.com/enso-org/enso/pull/1804)).
- Added `documentationHtml` field to Suggestions database entry
([#1791](https://github.com/enso-org/enso/pull/1791))

## Libraries

Expand Down
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ lazy val runtime = (project in file("engine/runtime"))
.dependsOn(searcher)
.dependsOn(testkit % Test)
.dependsOn(`logging-utils`)
.dependsOn(`docs-generator`)

/* Note [Unmanaged Classpath]
* ~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
/*
* Copyright 2013 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/*
* Copyright 2008 Google LLC
*
Expand All @@ -28,6 +14,20 @@
* limitations under the License.
*/

/*
* Copyright 2013 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/*
* Copyright 2008 Google LLC
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 The Error Prone Authors.
* Copyright 2014 The Error Prone Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* Copyright 2015 The Error Prone Authors.
* Copyright 2016 The Error Prone Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,7 +47,7 @@
*/

/*
* Copyright 2014 The Error Prone Authors.
* Copyright 2015 The Error Prone Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2017-2020 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com>
*/

/*
* Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2020 Lightbend Inc. <https://www.lightbend.com>
*/
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

Copyright 2017-2019 John A. De Goes and the ZIO Contributors

/*
* Copyright 2017-2020 John A. De Goes and the ZIO Contributors
* Copyright 2017-2018 Łukasz Biały, Paul Chiusano, Michael Pilquist,
Expand All @@ -34,5 +36,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Copyright 2017-2019 John A. De Goes and the ZIO Contributors
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011 Mathias Doenitz
* Copyright (C) 2011,2012 Mathias Doenitz, Johannes Rudolph
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* Copyright (C) 2011,2012 Mathias Doenitz, Johannes Rudolph
* Copyright (C) 2011 Mathias Doenitz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2017-2020 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com>
*/

/*
* Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2020 Lightbend Inc. <https://www.lightbend.com>
*/
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

Copyright 2017-2019 John A. De Goes and the ZIO Contributors

/*
* Copyright 2017-2020 John A. De Goes and the ZIO Contributors
* Copyright 2017-2018 Łukasz Biały, Paul Chiusano, Michael Pilquist,
Expand All @@ -34,5 +36,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Copyright 2017-2019 John A. De Goes and the ZIO Contributors
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011 Mathias Doenitz
* Copyright (C) 2011,2012 Mathias Doenitz, Johannes Rudolph
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* Copyright (C) 2011,2012 Mathias Doenitz, Johannes Rudolph
* Copyright (C) 2011 Mathias Doenitz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions docs/language-server/protocol-language-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ interface SuggestionEntryAtom {
arguments: SuggestionEntryArgument[];
returnType: string;
documentation?: string;
documentationHtml?: string;
}

interface SuggestionEntryMethod {
Expand All @@ -426,6 +427,7 @@ interface SuggestionEntryMethod {
selfType: string;
returnType: string;
documentation?: string;
documentationHtml?: string;
}

interface SuggestionEntryFunction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ object SearchProtocol {
* @param selfType the self type to update
* @param returnType the return type to update
* @param documentation the documentation string to update
* @param documentationHtml the HTML documentation to update
* @param scope the scope to update
*/
case class Modify(
Expand All @@ -214,6 +215,7 @@ object SearchProtocol {
selfType: Option[FieldUpdate[String]] = None,
returnType: Option[FieldUpdate[String]] = None,
documentation: Option[FieldUpdate[String]] = None,
documentationHtml: Option[FieldUpdate[String]] = None,
scope: Option[FieldUpdate[Suggestion.Scope]] = None
) extends SuggestionsDatabaseUpdate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ final class SuggestionsHandler(
arguments = m.arguments.map(_.map(toApiArgumentAction)),
returnType = m.returnType.map(fieldUpdate),
documentation = m.documentation.map(fieldUpdateOption),
scope = m.scope.map(fieldUpdate)
documentationHtml =
m.documentationHtml.map(fieldUpdateOption),
scope = m.scope.map(fieldUpdate)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import org.enso.polyglot.Suggestion
object Suggestions {

val atom: Suggestion.Atom = Suggestion.Atom(
externalId = None,
module = "Test.Main",
name = "MyType",
arguments = Vector(Suggestion.Argument("a", "Any", false, false, None)),
returnType = "MyAtom",
documentation = None
externalId = None,
module = "Test.Main",
name = "MyType",
arguments = Vector(Suggestion.Argument("a", "Any", false, false, None)),
returnType = "MyAtom",
documentation = None,
documentationHtml = None
)

val method: Suggestion.Method = Suggestion.Method(
Expand All @@ -24,9 +25,10 @@ object Suggestions {
Suggestion.Argument("this", "MyType", false, false, None),
Suggestion.Argument("foo", "Number", false, true, Some("42"))
),
selfType = "MyType",
returnType = "Number",
documentation = Some("Lovely")
selfType = "MyType",
returnType = "Number",
documentation = Some("Lovely"),
documentationHtml = Some("<p>Lovely</p>")
)

val function: Suggestion.Function = Suggestion.Function(
Expand Down Expand Up @@ -60,9 +62,10 @@ object Suggestions {
Suggestion.Argument("this", "Any", false, false, None),
Suggestion.Argument("that", "Any", false, false, None)
),
selfType = "Any",
returnType = "Any",
documentation = Some("Lovely")
selfType = "Any",
returnType = "Any",
documentation = Some("Lovely"),
documentationHtml = Some("<p>Lovely</p>")
)

val methodOnNumber: Suggestion.Method = Suggestion.Method(
Expand All @@ -72,9 +75,10 @@ object Suggestions {
arguments = Vector(
Suggestion.Argument("this", "Number", false, false, None)
),
selfType = "Number",
returnType = "Number",
documentation = None
selfType = "Number",
returnType = "Number",
documentation = None,
documentationHtml = None
)

val methodOnInteger: Suggestion.Method = Suggestion.Method(
Expand All @@ -84,9 +88,10 @@ object Suggestions {
arguments = Vector(
Suggestion.Argument("that", "Number", false, false, None)
),
selfType = "Integer",
returnType = "Number",
documentation = Some("Blah, blah")
selfType = "Integer",
returnType = "Number",
documentation = Some("Blah, blah"),
documentationHtml = Some("<p>Blah, blah</p>")
)

val all = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,13 @@ class SuggestionsHandlerSpec

val moduleName = "Test.Foo"
val moduleAtom = Suggestion.Atom(
externalId = None,
module = moduleName,
name = "Foo",
arguments = Vector(),
returnType = moduleName,
documentation = None
externalId = None,
module = moduleName,
name = "Foo",
arguments = Vector(),
returnType = moduleName,
documentation = None,
documentationHtml = None
)
val fooAtom = moduleAtom.copy(returnType = "Test.Foo.Foo")

Expand Down
Loading