Commit Graph

624 Commits

Author SHA1 Message Date
Mikhail Glukhikh 44ebec05bb FIR Java: support read of field constant initializers 2020-10-02 08:57:39 +03:00
Denis Zharkov 9914b487b7 FIR: Do not load hashCode/toString/equals methods from Java interface
As it's done in FE 1.0, and there are subtle semantics in the language that depends on it
2020-10-01 17:49:02 +03:00
Denis Zharkov 0297be1fa8 FIR: Replace callableId for intersection overrides 2020-10-01 17:49:02 +03:00
Mikhail Glukhikh ae23adb6f5 FIR Java: fix exception during synthetic property enhancement 2020-09-25 14:44:13 +03:00
Mikhail Glukhikh 368de43623 FIR Java: support Java setters more properly in use-site scope 2020-09-25 14:44:11 +03:00
Mikhail Glukhikh fe8e3e99ab [FIR Java] Hide function in scope in case it's an accessor by fact
#KT-42116 Fixed
2020-09-25 14:44:09 +03:00
Dmitriy Novozhilov 4ef57c120f [FIR] Consider variance of type parameters during java type enhancement
#KT-41940 Fixed
2020-09-24 15:43:20 +03:00
Dmitriy Novozhilov a0db510e49 [FIR] Split creating fir for java declarations to separate methods 2020-09-24 14:59:35 +03:00
Dmitriy Novozhilov 0e91c8f048 [FIR] Create synthetic properties for members of java annotations
#KT-41939 Fixed
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov d4891cb464 [FIR] Move Jsr305State from FirSession to separate component 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov 07a3009d43 Introduce new modules for common parts of deserialization 2020-09-11 10:08:37 +03:00
Dmitriy Novozhilov c82d9ea9f4 Remove dependency on :compiler:frontend.java from :compiler:fir:java 2020-09-11 10:08:36 +03:00
Dmitriy Novozhilov 1417fcecb8 Move more common parts from :compiler:descriptors.jvm 2020-09-11 10:08:36 +03:00
Vladimir Dolzhenko 5036673187 Improve package caching in KotlinJavaPsiFacade
^KT-33394 Fixed
2020-09-10 07:38:46 +00:00
Dmitriy Novozhilov 1a84ec9677 [FIR] Mark all session components respectively to they have mutable state or not
Also add documentation for all fir annotations
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov b81c0e91d5 Replace DescriptorVisibility with Visibility in Java model classes 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov a05d6da43b Move descriptor-independent Visibilities to common modules 2020-09-04 11:42:50 +03:00
Dmitriy Novozhilov d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Dmitriy Novozhilov 6db8c28291 [FIR] Refactor session components initialization
From now all customization of session should perform via DSL which
  declared in FirSessionFactory. Registration or mutation session
  services from other places is prohibited
2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov a8d23c36f5 [FIR] Introduce module :fir:entrypoint and FirSessionFactory for creating sessions 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 94d58c714a [FIR] Cleanup dependencies for fir modules 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 28e6050551 [FIR] Extract java synthetic names calculation to platform specific component 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 375140ebcc [FIR] Extract java class mapping to platform specific component 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov 3379d9b619 [FIR] Extract java related effective visibility calculation to platform component 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov ed4c6a38b6 [FIR] Move deserialization files to module :compiler:fir:fir-deserialization 2020-09-01 12:00:10 +03:00
Dmitriy Novozhilov a02109d857 [FIR] Add FirVisibilityChecker session component
This is needed because we have different visibility rules for different
  platform visibilities (e.g. protected and package private on JVM), so
  we need ability to configure visibility checks for different platforms
2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov 18ae593700 [FIR] Rename new visibilities to CamelCase
It's more convenient since they are objects now instead of
  const fields in FE 1.0
2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov 43821b681c [FIR] Introduce new Visibility class which not depends on descriptors 2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov e6837a5b8c [FIR] Unify implementations of toSymbol and getSymbolByLookupTag 2020-08-21 15:28:34 +03:00
Dmitriy Novozhilov ffdc68b68d [FIR] Get rid of AbstractFirSymbolProviderWithCache 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov 9032234e1d [FIR] Get rid of FirSymbolProvider.getNestedClassifierScope 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov 77f52a9ddb [FIR] Add special inline class for caches which are used in symbol providers 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov 4b6193159c [FIR] Get rid of JavaSymbolProvider.getJavaTopLevelClasses 2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov d7cfb2fb13 [FIR] Get rid of FirSymbolProvider.getClassNamesInPackage
There was one non-removable usage of those function in FirJavaElementFinder
  and three non-trivial implementation
- `FirProvider.SymbolProvider`
- `KotlinDeserializedJvmSymbolsProvider`
- `FirBuiltinSymbolProvider`

First implementation was moved to `FirProvider` and other two was
  deleted, because in FirJavaElementFinder we need lookup only in
  classes from source code, so such methods in library providers are
  useless

#KT-41048
2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov b31f80aee3 [FIR] Get rid of FirSymbolProvider.getAllCallableNamesInPackage
#KT-41048
2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov b4dc7955b4 [FIR] Avoid collections copying in FirSymbolProvider 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov d5bb87cd1f [FIR] Replace inheritance with delegation for FirProvider and FirSymbolProvider 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov ad9e41b828 [FIR] Mark JavaSymbolProvider.getJavaTopLevelClasses as @TestOnly 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov 1d26ce4a4e [FIR] Get rid of useless methods in FirSymbolProvider 2020-08-21 15:27:53 +03:00
Alexander Udalov 549ee84687 Fix some compiler warnings in FIR modules 2020-08-20 14:57:54 +02:00
Denis Zharkov 7f3f0faa1a FIR: Rework overridden members processing in FirTypeScope
Now, FirTypeScope returns only direct overridden and a base scope
where a client might look for deeper overridden

It's necessary to make the API fast and simple
when only direct overridden are needed

At the same time, while this API looks a bit complicated for most of the clients
there are simple extension helpers that obtain just the direct or all overridden
2020-08-20 11:18:59 +03:00
Oleg Ivanov 15598b62c9 [FIR] Add replaceControlFlowGraphReference function for FirFunction 2020-08-12 11:06:07 +03:00
Ilya Kirillov f62204fff1 FIR: move getCallableNames/getClassifierNames from scope to FirContainingNamesAwareScope 2020-08-09 12:04:52 +03:00
Ilya Kirillov 5f424ed1ec FIR IDE: rewrite low level API
- Cache ModuleResolveState for module till the world changes
- Resolve every file under a lock
- All creation of raw fir files and resolve of them happens in FirFileBuilder
- Lazy resolve of fir elements happens in FirElementBuilder

Caching works like the following:
- FirModuleResolveState holds PsiToFirCache & DiagnosticsCollector & FileCacheForModuleProvider
- FileCacheForModuleProvider holds a mapping from ModuleInfo to ModuleFileCache
- ModuleFileCache caches
    - KtFile -> FirFile mapping
    - ClassId -> FirClassLikeDeclaration, CallableId -> FirCallableSymbol
        which used in corresponding FirProvider
    - mapping from declaration to it's file
        which used in corresponding FirProvider
    - locks for fir file resolving
- PsiToFirCache provides mapping from KtElement to  FirElement
- DiagnosticsCollector collects diagnostics for file and caches them
2020-08-09 12:04:11 +03:00
Dmitriy Novozhilov 6596dc359b fixup! Completion with FIR (prototype, work-in-progress) 2020-08-09 12:00:04 +03:00
Ilya Kirillov d62500531b FIR: add getClassifierNames for FirScope 2020-08-09 11:59:57 +03:00
Roman Golyshev 656086f90a Add FirScope::getCallableNames function 2020-08-09 11:59:50 +03:00
Mikhail Glukhikh a6e811a67a [FIR] Add status to Java annotation constructor (fix after rebase) 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov b63257345b [FIR] Map Class to KClass in java annotations 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov bc1fa8ed7f [FIR] Add constructor for java annotations 2020-08-04 08:59:14 +03:00