summaryrefslogtreecommitdiff
path: root/test/scaladoc/run
Commit message (Collapse)AuthorAgeFilesLines
* Add regression tests for SI-10027SI-10027-testJakob Odersky2016-11-032-0/+13
|
* Fields phase expands lazy vals like modulesAdriaan Moors2016-08-291-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They remain ValDefs until then. - remove lazy accessor logic now that we have a single ValDef for lazy vals, with the underlying machinery being hidden until the fields phase leave a `@deprecated def lazyAccessor` for scala-refactoring - don't skolemize in purely synthetic getters, but *do* skolemize in lazy accessor during typers Lazy accessors have arbitrary user code, so have to skolemize. We exempt the purely synthetic accessors (`isSyntheticAccessor`) for strict vals, and lazy accessors emitted by the fields phase to avoid spurious type mismatches due to issues with existentials (That bug is tracked as https://github.com/scala/scala-dev/issues/165) When we're past typer, lazy accessors are synthetic, but before they are user-defined to make this hack less hacky, we could rework our flag usage to allow for requiring both the ACCESSOR and the SYNTHETIC bits to identify synthetic accessors and trigger the exemption. see also https://github.com/scala/scala-dev/issues/165 ok 7 - pos/existentials-harmful.scala ok 8 - pos/t2435.scala ok 9 - pos/existentials.scala previous attempt: skolemize type of val inside the private[this] val because its type is only observed from inside the accessor methods (inside the method scope its existentials are skolemized) - bean accessors have regular method types, not nullary method types - must re-infer type for param accessor some weirdness with scoping of param accessor vals and defs? - tailcalls detect lazy vals, which are defdefs after fields - can inline constant lazy val from trait - don't mix in fields etc for an overridden lazy val - need try-lift in lazy vals: the assign is not seen in uncurry because fields does the transform (see run/t2333.scala) - ensure field members end up final in bytecode - implicit class companion method: annot filter in completer - update check: previous error message was tangled up with unrelated field definitions (`var s` and `val s_scope`), now it behaves consistently whether those are val/vars or defs - analyzer plugin check update seems benign, but no way to know... - error message gen: there is no underlying symbol for a deferred var look for missing getter/setter instead - avoid retypechecking valdefs while duplicating for specialize see pos/spec-private - Scaladoc uniformly looks to field/accessor symbol - test updates to innerClassAttribute by Lukas
* Javadoc: make parsing of java comments optionalJakob Odersky2016-08-133-11/+23
|
* Javadoc: fix problems in community buildJakob Odersky2016-08-131-1/+1
| | | | | | | - fix initialization NPE in doc headers - fix assertion errors for java fields - ignore comments when deciding where to put interface methods - consider DocDefs when checking for constructors
* Merge pull request #5231 from gourlaysama/ticket/t9585-scaladoc-wrong-implicitsStefan Zeiger2016-08-122-0/+31
|\ | | | | SI-9585 hide auto-implicit conversions from scaladoc
| * SI-9585 hide auto-implicit conversions from scaladocAntoine Gourlay2016-06-062-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This hides implicits conversions (and potential members obtained through it) that converts a type into itself, because these conversions are usually non-sensical. They are not completely removed, just placed behind `-doc-implicits-show-all`, like other implicits deemed probably useless. --- Consider the scaladoc for the following class: ``` object Box { implicit def anyToBox[T](t: T): Box[T] = new Box(t) } class Box[T](val t: T) ``` When looking for implicits members to add to class `Box`, it finds the implicit conversion `anyToBox`, and applies it to itself to have an implicit conversion to Box[Box[T]], which brings a useless implicit member `t: Box[T]`. This commit makes scaladoc ignore any conversion from a type to itself (even if type parameters differ) by default. Using the (very useful) `tools/scaladoc-diff` script, I found that this change removes the following conversion from the library doc: ``` Ensuring[A] to Ensuring[Ensuring[A]] anytostringadd[A] to any2stringadd[anytostringadd[A]] ArrowAssoc[A] to ArrowAssoc[ArrowAssoc[A]] =:=[From,To] to =:=[From,To] SearchImpl[A,Repr] to SearchImpl[A,SearchImpl[A,Repr]] CollectionsHaveToParArray[C, T] to CollectionsHaveToParArray[CollectionsHaveToParArray[C, T], T] Ordered[A] to Ordered[Ordered[A]] StringFormat[A] to StringFormat[StringFormat[A]] ```
* | Retain javadoc comments in scaladocJakob Odersky2016-07-152-0/+31
| | | | | | | | | | * Hook into java parser to generate doc comments * Generate empty trees for java implementation bodies
* | Merge commit 'aaf7bc0' into merge-2.11-to-2.12-june-19Lukas Rytz2016-06-212-7/+25
|\ \ | |/ |/|
| * Use sbt for PR validationStefan Zeiger2016-06-142-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Support directories in `-doc-external-doc`: It is documented as accepting a “classpath_entry_path” for the keys but this only worked for JARs and not for individual class files. When checking for external-doc mappings for a Symbol, we now find the root directory relative to a class file instead of using the full class file path. The corresponding tests for SI-191 and SI8557 are also fixed to support individual class files instead of JARs in partest. This is required for the sbt build which runs partest on “quick” instead of “pack”. - Fix version and repository handling for bootstrapping. The bootstrap `scalaInstance` can now be resolved from any repository added to the project (not just the bootstrap repositories) by using a different workaround for https://github.com/sbt/sbt/issues/1872. - Workaround for https://github.com/sbt/sbt/issues/2640 (putting the wrong `scalaInstance` on partest’s classpath). The required `ScalaInstance` constructor is deprecated, so we have to disable deprecation warnings and fatal warnings until there is a better fix. - Add MiMa to the sbt build (port of the old `test.bc` ant task). The sbt-mima plugin doesn’t have all the features we need, so we do it manually in a similar way to what the plugin does. Checks are done in both directions for the `library` and `compiler` projects. The base version has to be set in `build.sbt`. When set to `None`, MiMa checks are skipped. MiMa checks are run sequentially to avoid spurious errors (see https://github.com/typesafehub/migration-manager/issues/115). - Port the OSGi tests to the sbt build. The set of JARs that gets copied into build/osgi as bundles is a bit different from the ant build. We omit the source JARs but add additional modules that are part of the Scala distribution, which seems more correct. - Get rid up `pull-binary-libs.sh` for the sbt build. Add artifacts are resolved from the special bootstrap repository through Ivy. The special `code.jar` and `instrumented.jar` artifacts are copied to the location where partest expects them (because these paths are hardcoded in partest). Other extra JARs for partest in `test/files/lib` are referenced directly from the Ivy cache. - Move common settings that should be available with unqualified names in local `.sbt` files and on the command line into an auto-plugin. - Add an `antStyle` setting to sbt to allow users to easily enable ant-style incremental compilation instead of sbt’s standard name hashing with `set antStyle := true`. - Disable verbose `info`-level logging during sbt startup for both, `validate/test` and `validate/publish-core` jobs. Update logging is no longer disabled when running locally (where it is useful and doesn’t generate excessive output). - Pass optimization flags for scalac down to partest, using the new partest version 1.0.15\6. - Call the new sbt-based PR validation from `scripts/jobs/validate/test`. - Disable the tests `run/t7843-jsr223-service` and `run/t7933` from https://github.com/scala/scala/pull/4959 for now. We need to set up a new test project (either partest or junit) that can run them on a packaged version of Scala, or possibly move them into a separate project that would naturally run from a packaged Scala as part of the community build.
* | SI-9752 never ignore blank lines when parsing code blocks (#5125)Antoine Gourlay2016-05-022-0/+33
| | | | | | | | | | The default behavior when parsing the content of a tag text (like after `@example`) was to ignore empty lines. That's fine, except when we are in the middle of a code block, where preserving formatting matters.
* | Remove unused classes from ScaladocFelix Mulder2016-03-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Several elements of the old Scaladoc are not in use anymore. To help with any reverting, the removal of these is done in a single commit (this one). The removal includes: - Old `Index`, the old top "index.html" - The letter index (with "_" and "deprecated") - The old `Template` which is superceded by `Entity`
* | Add doc annotation `@shortDescription` to enable explicit synopsisFelix Mulder2016-02-223-1/+56
| | | | | | | | | | | | | | | | Entities with this annotation will be able to control what is shown in the method summary on entity pages as well as the hover text on search results. Review: @VladUreche
* | Scaladoc: Add new search, featuring entity and member searchFelix Mulder2016-02-172-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a revamped search function for the scaladoc tool. It also contains a number of small fixes for HTML-layout and JavaScript issues. The search is implemented by enhancing the scheduler and using JavaScript promises. List of changes/additions: * Revamped search functionality - Search members as well as entities - Preserve keyboard navigation - Scroll to selected entity if outside of viewport - Non-blocking, cancelable * Display of library name (top left) * Refactored scheduler * Cleanup of HTML layout - Remove left pane - Better mobile layout, no need for dynamic offsets - Remove unused element classes - Remove iframe structure - Better layout for kinds
* | SI-9620: add doc annotation to hide specific conversionsFelix Mulder2016-02-092-0/+44
| | | | | | | | | | | | | | | | | | | | | | This commit will introduce the doc annotation `@hideImplicitConversion`. By specifying which conversions to hide, the user can "toggle" which conversions are kept in the parsed entity. This implementation is a better workaround than hardcoding which ones to ignore when running scaladoc. Review: @VladUreche
* | Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-042-0/+69
|\| | | | | | | | | | | Conflicts: build.sbt scripts/jobs/integrate/bootstrap
| * Trim complexity in CommentFactoryBaseJanek Bogucki2016-01-252-0/+69
| | | | | | | | | | | | | | | | | | | | 1. Replace option handling with library call 2. Remove NumberFormatException catch presumed to be copy/paste legacy 3. It's Scaladoc 4. Parse trailing whitespace regex once instead of per line 5. Use string interpolation where it improves readability 6. Add missed alternative to block grammar production rule 7. Add regression test for tag requirement warnings
* | Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-241-1/+1
|\|
| * it's Scaladoc, not "ScalaDoc" or "Scala doc"Seth Tisue2015-11-121-1/+1
| | | | | | | | | | renaming the existing ScalaDoc and ScalaDocReporter classes might break stuff, sadly, but at least we can fix the rest
* | Merge commit 'a170c99' into 2.12.xLukas Rytz2015-09-225-0/+0
|\|
| * unset inappropriate execute bitsSeth Tisue2015-09-025-0/+0
| | | | | | | | | | | | | | | | | | | | I imagine these date back to old Subversion days and are probably the result of inadvertent commits from Windows users with vcs client configs. having the bit set isn't really harmful most of the time, but it's just not right, and it makes the files stand out in directory listings for no reason
* | Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624Jason Zaugg2015-06-244-2/+27
|\|
| * Fix 36 typos (d-f)Janek Bogucki2015-06-211-1/+1
| |
| * Fix another several typosMichał Pociecha2015-06-181-1/+1
| | | | | | | | | | | | I just used text search to check whether there are no more typos like these corrected by janekdb, and by the way fixed also some other ones which I saw.
| * SI-8210 Scaladoc: Fix the false negative @inheritdoc warning on accessorsKato Kazuyoshi2015-05-272-0/+25
| | | | | | | | | | This fix is just for the false negative warning. Probably we can skip setters entirely, but I'm not 100% sure.
* | Merge commit 'fedbfd7' into merge/2.11-to-2.12-apr-21Lukas Rytz2015-04-212-0/+67
|\|
| * SI-5795 empty scaladoc tags should be omitted from outputAntoine Gourlay2015-04-022-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | Empty scaladoc tags, like `@param`, `@return`, `@version`, etc. should be omitted from the output when they have no meaning by themselves. They are still parsed, for validation (warning that a tag doesn't exist and so on), but are removed, if empty, when building the Comment. The only ones that stay even when empty are `@deprecated`, so that the class name can be striked-through ("Deprecated" also appears in the header, even if there is no message with it), and `@throws`.
* | Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-01-294-0/+86
|\| | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
| * SI-5730 hide constructors of sealed abstract classes in scaladocAntoine Gourlay2014-11-072-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sealed abstract classes (like `List`) have a primary constructor, public by default. It can never be called by external code but it shows up in the scaladoc as a nice `new List()` construtor... If a class is only abstract, the constructor is still useful because people can subclass and call it. If it is only sealed (i.e. effectively final), then it is the normal constructor of a final class. But sealed *and* abstract makes documenting the constructor useless. This should remove the misleading constructors of `List`, `Double`, `Option` and others from the scaladoc.
| * SI-6626 make @throws tags create links to exceptionsAntoine Gourlay2014-11-052-0/+49
| | | | | | | | | | | | In scaladoc, this turns exceptions in @throws tags into links (when it can find the target exception), instead of just showing the name.
* | Merge commit 'abd595d' into merge/2.11.x-to-2.12.x-20140915Jason Zaugg2014-09-162-0/+37
|\|
| * SI-8113 allow a newline between a link target and titleAntoine Gourlay2014-09-032-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Parsing "[[http://foo.bar link title]]" stops at the first whitespace. This breaks pretty badly in: [[http://foo.bar link title]] It stops after "link", interprets what it parsed as a link to a member, obviously fails, and then just ouputs "title". It should at least return a proper error, or, even better, just allow a newline between the target and title. I went for the latter.
* | Merge branch 'merge/2.10-to-2.11-sept-2' into ↵Lukas Rytz2014-09-022-0/+19
|\| | | | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer Conflicts: versions.properties
| * Merge commit 'b5759ef' into merge/2.10-to-2.11-sept-2Lukas Rytz2014-09-022-0/+19
| |\
| | * Prevent SI-8314 by adding a testKato Kazuyoshi2014-07-312-0/+19
| | | | | | | | | | | | The original issue was fixed already. This test is just for make sure.
* | | Merge commit '01f2d27' into ↵Lukas Rytz2014-09-022-0/+33
|\| | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer
| * | Merge pull request #3883 from gourlaysama/wip/t8557Vlad Ureche2014-07-152-0/+33
| |\ \ | | | | | | | | SI-8557 make scaladoc normalize paths of external jars.
| | * | SI-8557 make scaladoc normalize paths of external jars.Antoine Gourlay2014-07-152-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | Scaladoc compares (string representations of) the paths from -doc-external-doc and the paths form `sym.underlyingSource`. We now normalize on both ends before comparing them.
* | | | Prevent SI-7905 by adding a testKato Kazuyoshi2014-07-312-0/+37
|/ / / | | | | | | | | | The original issue was fixed already. This test is just for make sure.
* / / SI-8672 Better end-of-sentence detection for ScaladocJason Zaugg2014-06-202-0/+36
|/ / | | | | | | | | | | | | | | | | The first sentence of a Scaladoc comment is parsed as the summary. However, this was breaking of the sentence at the first `.`, even if that was immediately followed by another character. This commit only considers a period followed by whitespace, EOL or EOF as the end of a sentence.
* | Merge commit 'ec05aeb' into topic/merge-2.10.xJason Zaugg2014-05-082-0/+33
|\|
| * SI-8479 Fix constructor default args under scaladocJason Zaugg2014-04-072-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `DocDef` node hid the `DefDef` constructor from the scrutinee of the namer when determining if the class had constructor defaults or not. The current pattern for fixing these bugs is to delegate the check to `TreeInfo`, and account for the wrapper `DocDef` node. I've followed that pattern, but expressed my feelings about this approach in a TODO comment. Before this patch, the enclosed test failed with: error: not enough arguments for constructor SparkContext: (master: String, appName: String)SparkContext
* | SI-8407 "symbol not found" in Scaladoc use cases: warning onlyJason Zaugg2014-03-132-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring in aedec1980 mistakenly used the non-silent typer to typecheck the use cases. It temptingly had the desired type (`ScalaDocAnalyzer`), but sadly the wrong properties (it will report errors, rather than buffer.) This meant that "symbol not found" errors in use cases would prevent Scaladoc generation. This commit introduces a little downcast on the silent typer. A more principled approach would be to go through the rigmarole of the virtual class pattern for `Analzyer.Typer`, but that will have to remain work for another day.
* | SI-8229 Source compatible name for implicit any2stringaddJason Zaugg2014-02-182-2/+2
| | | | | | | | | | | | | | | | | | | | To support the established pattern for disabling it for an compilation unit. Update scaladoc's knowledge of our "typeclasses". Leave a `private[scala]` version of `StringAdd` (public in bytecode) to ensure binary compatibility with 2.11.0-M8 for partest.
* | SI-7124 make macro definitions prettier in scaladocAntoine Gourlay2014-01-312-0/+25
| | | | | | | | | | | | Macros are now prettier in scaladoc, by - hiding the `macroImpl` annotation - showing the `macro` modifier in front
* | *boxContext => *box.Context , *boxMacro => *box.MacroEugene Burmako2014-01-122-4/+4
| | | | | | | | | | | | | | | | | | | | Performs the following renamings: * scala.reflect.macros.BlackboxContext to scala.reflect.macros.blackbox.Context * scala.reflect.macros.BlackboxMacro to scala.reflect.macros.blackbox.Macro * scala.reflect.macros.WhiteboxContext to scala.reflect.macros.whitebox.Context * scala.reflect.macros.WhiteboxMacro to scala.reflect.macros.whitebox.Macro https://groups.google.com/forum/#!topic/scala-internals/MX40-dM28rk
* | Use macro expandee, rather than expansion, in pres. compilerJason Zaugg2014-01-084-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presentation compiler is primarily interested in trees that represent the code that one sees in the IDE, not the expansion of macros. This commit continues to expand macros, but adds a hook in which the presentation compiler discards the expansion, retaining instead the expandee. The expandee is attributed with the type of the expansion, which allows white box macros to work. In addition, any domain specific errors and warnings issued by the macro will still be reported, as a side-effect of the expansion. The failing test from the last commit now correctly resolves hyperlinks in macro arguments. Related IDE ticket: https://www.assembla.com/spaces/scala-ide/tickets/1001449# This facility is configured as follows: // expand macros as per normal -Ymacro-expand:normal // don't expand the macro, takes the place of -Ymacro-no-expand -Ymacro-expand:none // expand macros to compute type and emit warnings, // but retain expandee. Set automatically be the presentation // compiler -Ymacro-expand:discard This leaves to door ajar for a new option: // Don't expand blackbox macros; expand whitebox // but retain expandee -Ymacro-expand:discard-whitebox-only The existing test for SI-6812 has been duplicated. One copy exercises the now-deprecated -Ymacro-no-expand, and the other uses the new option.
* | deprecates macro def return type inferenceEugene Burmako2013-12-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new focus on quasiquotes in macro implementations, we now have to change the way how inference of macro def return types works. Previously, if the return type of a macro def wasn’t specified, we looked into the signature of its macro impl, took its return type (which could only be c.Expr[T]) and then assigned T to be the return type of the macro def. We also had a convenient special case which inferred Any in case when the body of the macro impl wasn’t an expr. That avoided reporting spurious errors if the macro impl had its body typed incorrectly (because in that case we would report a def/impl signature mismatch anyway) and also provided a convenience by letting macro impls end with `???`. However now we also allow macro impls to return c.Tree, which means that we are no longer able to do any meaningful type inference, because c.Tree could correspond to tree of any type. Unfortunately, when coupled with the type inference special case described above, this means that the users who migrate from exprs to quasiquotes are going to face an unpleasant surprise. If they haven’t provided explicit return types for their macro defs, those types are going to be silently inferred as `Any`! This commit plugs this loophole by prohibiting type inference from non-expr return types of macro impls (not counting Nothing). Moreover, it also deprecates c.Expr[T] => T inference in order to avoid confusion when switching between exprs and quasiquotes.
* | SI-7876 Less dealiasing in Scaladoc's type printing.Jason Zaugg2013-09-263-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc renders tuple and function types with the syntactic sugar. To do so, it was using `isFunctionType` and `isTupleType`. Internally, these methods dealias, so one can't simply take the type arguments from the given type to get the element types of the tuple. In ac96200c92, a Scaladoc crasher in this area was resolved by normalizing a type before extracting Tuple type arguments. Similar code already existed in the handling of FunctionTypes. This commit goes in the opposite direction, and instead queries the `direct` versions of those methods, which do not perform dealiasing. Conseqeuently, the type aliases that appear in the source code signatures for members will be rendered as such in Scaladoc. Which seems like an improvement.
* | SI-7876 Scaladoc crasher due to regression in isFunctionType.Jason Zaugg2013-09-262-0/+20
| | | | | | | | | | | | | | | | | | | | | | `isFunctionType` and `isTupleType` started returing true for type constructors as of aeb73314. This led to a crash in type printing in ScalaDoc (specfically, in ModelFactoryTypeSupport.scala) This commit: - fixes those methods by guarding with !isHigherKinded - unit tests said methods - tests the reported crasher with a ScalaDoc test.
* | Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-masterJason Zaugg2013-09-102-0/+19
|\| | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala